How to support multiple I2C slaves in the RL78/L12 MCU?

I am trying to use the RF10RGA MCU to develop a LCD/Keypad application, it need 2 I2C slaves accordingly for keyPad and LCD controller.

I used the CS+ to generate the code, but it only could support one I2C configuration.

How should I do? I there any reference code for this?

Parents
  • Hello,

    The IICA module supports multiple slaves on the bus:

    If you have multiple slaves on the bus just change the address argument of R_IICA0_Master_Send and R_IICA0_Master_Receive to send and receive data on a different address.

    Regards

  • Thanks for your reply. My design is to act as 2 I2C slaves for the I2C master to read/write data to my unit. When I generate the slave I2C code by the CS+ IDE, it only could generate the code of one slave. Could I make my unit to be as 2 slaves for the other master? 

  • Hello,

    On RL78/L12 there is only 1 IICA channel and thus it can be configured as master or slave with one slave address.

    You cannot configure the device to have 2 different slave address at the same time.

    You need to stop the operation using the 1st slave address, change the address and re-start the operation using the 2nd slave address.

Reply
  • Hello,

    On RL78/L12 there is only 1 IICA channel and thus it can be configured as master or slave with one slave address.

    You cannot configure the device to have 2 different slave address at the same time.

    You need to stop the operation using the 1st slave address, change the address and re-start the operation using the 2nd slave address.

Children