Go Down

Topic: I2C Broadcast via address 0x00 (Read 5119 times) previous topic - next topic

amphibious

Hi together,

I was wondering whether sending a message on the I2C bus to the address 0x00 actually results in a General Call when using Arduinos Wire library for all clients. The detailed reference of the Wire library [1] states that this option is deactivated by default. I have been looking around in the forum and there was some talk about using the General Call but as far as I see there were no Arduino slaves involved.

Quote
Note that in the Wire library, the TWGCE bit is not set. This means that the Arduino will not respond to the I2C General Call address (address 0x00, which is basically an I2C broadcast).


Would I have to activate this option by setting that bit? Why is it deactivated anyway?

Thanks and Cheers
ff




[1] http://playground.arduino.cc/Main/WireLibraryDetailedReference

nickgammon

http://www.gammon.com.au/i2c

A sketch there shows a board reacting to the general call.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Erdin

Setting the TWAR register is the only thing that is needed ?
http://www.gammon.com.au/forum/?id=10896&reply=1#reply1
I might try that for myself.

amphibious


So, in setup()

Quote
TWAR = (MY_ADDRESS << 1) | 1;  // enable broadcasts to be received


does the trick? Thanks once again, Nick!!!

Just to be sure: would adding 128 to MY_ADDRESS do the same thing?

Cheers
ff

nickgammon

No because the address is shifted left. That bit is the low-order bit not the high-order one.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up