Download RL78/G10 EEPROM Control by Simplified I2C Function

Transcript
RL78/G10
5.5
EEPROM Control by Simplified I2C Function
Variables
Table 5.6 lists the variables that are used in this sample program.
Table 5.6 Variables for the Sample Program
Variable
NEXTADR
EEPROMADDR
BLOCK_NUMBER
Outline
Stores a transfer destination address.
Specifies EEPROM address.
Specifies the block number which EEPROM of a controlled object wants
to access.
WRITE_BUFF
READ_BUFF
R_BUFF_END
STATUS
DATACOUNT
SLAVEADDR
Sets data to write in EEPROM.
A buffer which stores read data from EEPROM.
Stores data which is received at the end of specified size.
Stores the status of I2C interrupt control function by function.
Stores the number of data of I2C writing or reading.
Slave address of I2C.
5.6
Function (Subroutine) List
Table 5.7 and Table 5.8 shows the function (subroutine).
Table 5.7 Function (External Function)
Function
PUTDATA
GETDATA
PUT_ CHK
GET_ CHK
WAIT_END
StopCond
R_IIC00_Init
SINITAU
IINTIIC00
Outline
Writing start processing to the specified block
Reading start processing from the specified block
Writing to EEPROM state check processing
Reading from EEPROM state check processing
Waiting processing for the completion of access to EEPROM
Execution of stop condition to I2C bus
Initialization of IIC00
Initialization of TAU01
IIC00 interrupt handler
Table 5.8 Function (Internal Processing Function)
Function
StartCond
R_IIC00_send_Stop
R_IIC00_wait_bus
R_IIC00_SCL_pulse
R_IIC00_SCL_high
R_IIC00_SCL_low
R_IIC00_SCL_Time
get_slave_Addr
R01AN2217EJ0100 Rev. 1.00
Sep. 17, 2014
Outline
Generates start condition to I2C bus
Generates stop condition to I2C bus
Releases I2C bus
Outputs SCL signal of 1 pulse
Raises SCL signal to high
falls SCL signal to low
Secures the time of the pulse width of a SCL signal
Calculates the address in I2C bus of EEPROM
Page 23 of 81