Closed andkae closed 9 months ago
Hi Andreas!
Yes, you are right, you can detect that another master has occupied the bus using the Bus Busy bit (BB).
Each pair of SCL / SDA signals connected to IICMB has a personal bus state analyzer attached (bus_state.vhd) that constantly monitors the bus state to detect start and stop conditions. Bus Busy bit = 1 means that a start condition has been observed on the bus, which means someone has captured it. This "someone" could be you or another master on the bus. To determine who has captured the bus you can refer to the Bus Captured (BC) bit. A value of 1 for this bit means the IICMB occupied the bus, a value of 0 means that the bus is occupied by someone else.
So, to summarize: a. BB = 0; -- the bus is free b. BB = 1, BC = 0; -- the bus has been captured by other master c. BB = 1, BC = 1; -- IICMB occupies the bus
Best regards, Sergey
Hi Sergey,
thanks for the clarification. I'll prepare an PR to add this funcs to iicmb.c.
BR, Andreas
done in PR https://github.com/sshuv/iicmb/pull/9
Hi Sergey,
in the datasheet is written that the IICMB supports multi master. How i can detect that another master has occupied the bus?
In my opinion it's the Bus Busy or Bus captured bit:
But on another place is written: Bus Bysy bit (BB) and Bus Captured (BC) bit (as well as Bus ID field) should be used mostly for diagnostic purposes. For example, there is no need to refer to BB bit to determine bus busyness before giving a Start command – this is done automatically by the byte-level FSM.
Do you have a suggestions for me?
Thanks for your support.
BR, Andreas