The I2C Slave interface of EFM8LB1 is a 2-wire, bidirectional serial bus that is compatible with the I2C Bus Specification 3.0. It is capable of transferring in high-speed mode (HS-mode) at speeds of up to 3.4 Mbps, and fully downward compatible with slower speed devices.
It also supports clock stretching for cases where the core may be temporarily prohibited from transmitting a byte or processing a received byte during an I2C transaction.
By default, the I2C bus operates at speeds of up to Fast-mode (F/S mode) only, where the maximum transfer rate is 400 kbps. And it will switch from F/S mode to HS-mode only with the following sequence:
The HS-mode master codes (0x08 – 0x0F) are reserved 8-bit codes which are not used for slave addressing or other purposes.
The HS-mode compatible I2C master will switch the I2C bus to HS-mode by transmitting the above sequence at a transfer rate of not more than 400 kbps. After that, it will transfer data at a rate of up to 3.4 Mbps. And the I2C bus will switch back to F/S mode when the I2C master transmits a STOP bit.
As below is the High Speed (HS) exercise of EFM8LB1 with the I2C master JI-300. The I2C slave example code can be get after installing the Simplicity Studio.
After setting up the basic environment, a set of messages and instruction should be added to the Message List of master JI-300 to exercise the EFM8LB1 in HS-Mode.
Four types will be added: two I2C messages – Read and Write, and two instructions – HS-Mode Set and Comment. Please refer to the JI-300 user manual for the detailed steps for how to add the messages.
To expedite data entry, please just use the attached setup file “JI300_efm8lb1.ser” to load the message list. The figure as below illustrated the meaning of each message and instruction.
In the exercise, the default setting of master code is “0x08”. As below is the captured signal, which show that the transfer rate for the sequence is 400 kbps.
After transmitting the above sequence, master will switch to HS-mode to transfer data at a rate of up to 3.4 Mbps. For example, set the Frequency of master JI-300 to 2.0M, the transfer rate will switch from 400 kbps to 2.0 Mbps.
Since the I2C bus will switch back to F/S mode when the I2C master transmits a STOP bit, so please just remove the STOP bit for all messages following the HS-mode Set instruction to support continue data transfers.