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?
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.
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?
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.
Thanks a lot, would you tell me how to stop and re-start the I2C operation with another slave address?
Actually you do not have to stop and restart, just change the slave address register.
Make sure not to do this while a start condition arrives from master.