Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:56 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : I2C with mx170 & rpi

Author Message
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 02:21pm 24 Jul 2018
Copy link to clipboard 
Print this post

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 BME280Edited by goc30 2018-07-26
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:09pm 24 Jul 2018
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 5091
Posted: 06:54am 26 Jul 2018
Copy link to clipboard 
Print this post

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: France
Posts: 435
Posted: 09:33pm 26 Jul 2018
Copy link to clipboard 
Print this post

  Volhout said   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.


Volhout


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
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025