I2C Broadcast via address 0x00

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.

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

[1] Arduino Playground - WireLibraryDetailedReference

A sketch there shows a board reacting to the general call.

Setting the TWAR register is the only thing that is needed ?

I might try that for myself.

So, in setup()

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?


No because the address is shifted left. That bit is the low-order bit not the high-order one.