User`s manual
RX62N Group, RX621 Group 5. Usage Examples
3) Repeated Start
I²C channel 1 will be configured for Master operation. The memory address pointer of an EEPROM will be
modified, and then a Repeat Start condition used to change to read the byte at that memory location in the
EEPROM.
Figure 5-30: The bus activity, showing the Repeated Start condition when switching to the Read
process
/* Send 1 byte to the EEPROM to update the lower address bits and do not stop */
uint8_t byte_to_send = 0x37;
R_IIC_MasterSend(
0,
PDL_IIC_STOP_DISABLE,
EEPROM_ADDRESS,
&byte_to_send,
1,
PDL_NO_FUNC,
0
);
/* Read data from the EEPROM. A repeated start will occur. */
R_IIC_MasterReceive(
0,
PDL_NO_DATA,
EEPROM_ADDRESS,
data_storage,
2,
PDL_NO_FUNC,
0
);
Figure 5-31: Set the lower address to 37h and then read 2 bytes.
Slave address
A
Data
A
P
R
Data
A
S
Slave address
W
A
Memory address
A
Sr
R20UT0084EE0112 Rev.1.12 Page 5-50
July. 16, 2014