I2C (Wire)

The I2C, or Wire as it is called in the world of Arduino, is a two wire serial bus that allow many master and slave devices to communicate with each other over the same bus. It is therefore an efficient way to connect many devices using only two wires. Each device has its own address that is used when communicating with the device. Many ICs and also units, e.g. some LCDs, communicate via I2C. The I2C bus can run at 100 kHz (default) or 400 kHz.

The RFzero has an internal I2C bus that is used by the EEPROM and Si5351A exclusively. The internal I2C bus is automatically initialized when the RFzero.Init() function is called.

But there is also an I2C user bus available on D8 (SDA) and D9 (SCL) on the JP9 connector. The below program shows how to active and use the RFzero I2C user bus connected to a Semtech SX1509 port expander device. The principle is the same for the default I2C bus on the Arduino Zero and Arduino M0 boards.

If you want to use the above example on your Arduino Zero or Arduino M0 default I2C/Wire pins please note that the pins don’t match directly with the RFzero as the below table shows.

I2C signalRFzero Pin/PortArduino Zero or M0 pins
SDAD8/PA16SDA/PA22
SCLD9/PA17SCL/PA23

Don’t forget to connect the pull-up resistors on the RFzero too, 4,7 kΩ to 10 kΩ will work in most cases.

Please note that if your I2C device(s) use 5 V you will need a 3,3 V to/from 5 V level converter that can be made either by discrete components, ready made board or an IC. Please see the Third party accessories section on the Shop page.

For more information about the I2C bus please see the application report from Texas Instruments: Understanding the I2C Bus.