![]() |
Forum Index : Microcontroller and PC projects : I2C with mx170 & rpi
Author | Message | ||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
Hi all My problem is simple. I have 2 mx170 (mx170-A & mx170-B) in micromite (v 5.4.10 beta4) and one rpi. In my project, mx170-B receive datas from mx170-A, collects some other locals gpio and send all to rpi The first mx170 (module A) works in i2c slave, the second mx170 (module B) works in master with the mx170-A and in slave with the Rpi. the Rpi is developed in Python with jessie and is master. mx170-A and mx170-B talk without problem. mx170-B and rpi talk without problems. but the 3 at the same time: it does not work. The rpi can't see the i2c bus (i2cdetect function). I solved the problem by passing the mx170-A as a slave with the Rpi and not with the mx170-B. I would just like to know if it is normal or not that the rpi does not see the i2c bus when the 2 mx170 are talking. ps: I understand that you can't use 2 masters in same time. Thi is not a problem. It is juste that in case of use 2 pic's who talk with i2c, Rpi can't use others I2c modules like BME280 |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Master controls the bus. If you have two of them then you have a conflict. A master pushes and pulls info. Slaves just respond. If you need two masters then use a bus-master selector chip like the PCA9541. Or keep it simple an use a single master per I2c bus. Microblocks. Build with logic. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
Hi GOC30, In the manual it says you can use master and slave functions simultaneous on micromite B. It makes life pretty complicated though. Since you have to arbiter in software when what happens. Your later test with 2 slaves and one master is so much easier. There is a small leftover of the maximite manual in the micromite manual (result of RTFM....). It confuses with pins 12 and 13.... Volhout PicomiteVGA PETSCII ROBOTS |
||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
You are right. with pic, I have no problem, I can work in master or slave mode with same proc, but rpi don't want to play this "game". If it see one time, dial master/slave (idem with other adr), it lost i2c bus (i2cdetect say false infos), and i must reboot rpi card |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |