
III PERIPHERAL BLOCK: SINGLE MASTER I2C-BUS
EPSON
S1C33T01 FUNCTION PART
B-III-9-6
Note that when generating an interrupt at transfer command completion, it is necessary to enable the command
complete interrupt by setting to "1" both IC_CMPx in the interrupt control/status register in the single-master
I
2 C-bus core and the EI2CIx interrupt enable bit in the Ch. 0/1 interrupt enable register in the single-master
I
2 C-bus core in the interrupt controller. (See the "Single-Master I2C-Bus Interrupts and DMA" item for detailed
information on interrupts.)
Transmit procedure
The single-master I
2 C-bus core includes both a transmit shift register and a transmit data register (used as a
transmit data buffer).
Ch. 0 transmit data: I2CTD0[7:0] (D[7:0]) / Single-master I
2 C-bus Ch. 0 transmit data register (0x40320)
Ch. 1 transmit data: I2CTD1[7:0] (D[7:0]) / Single-master I
2 C-bus Ch. 1 transmit data register (0x40330)
After writing data to this register and setting the bus to the busy state by writing "001" (generate start condition)
to the TRNSx[2:0] control register, one byte of data can be transmitted (MSB first) by writing "100" to
TRNSx[2:0] to execute the data transmit command. The acknowledge (ACK) from the slave will be reflected in
the error status register RACK flag. Data can be transmitted continuously be repeating the sequence of first
writing the next data to be sent and setting TRNSx[2:0] to "100" (data transmit command). After the stipulated
number of bytes have been transmitted, return the bus to the free state by writing "010" to TRNSx[2:0] to
execute the generate stop condition command.
Receive procedure
The single-master I
2 C-bus core includes both a receive shift register and a receive data register (used as a
receive data buffer).
Ch. 0 receive data: I2CRD0[7:0] (D[7:0]) / Single-master I
2 C-bus Ch. 0 receive data register (0x40321)
Ch. 1 receive data: I2CRD1[7:0] (D[7:0]) / Single-master I
2 C-bus Ch. 1 receive data register (0x40331)
After setting the bus to the busy state by writing "001" (generate start condition) to the TRNSx[2:0] control
register, one byte of data can be received (MSB first) by writing "011" to TRNSx[2:0] to execute the data
receive command. An acknowledge (ACK) can be sent to the slave by setting TACK in the control register to
"1".
Data can be received continuously by repeating the sequence of first reading out the received data, then setting
TRNSx[2:0] to "011" (data receive command) and then sending an ACK. After the stipulated number of bytes
have been received, return the bus to the free state by writing "010" to TRNSx[2:0] to execute the generate stop
condition command.
Data transfer and I
2C-bus status
The command run state (RUNx), the SDAx and SCLx pin states (SSDAx and SSCLx),the bus usage state of the
single-master I
2 C-bus (UBx), the I2C-bus state (BBx), the error flag (EHx), and the transfer command
completion (CMPx) status states are reflected in the following registers.
Ch. 0 status: single-master I
2 C-bus Ch. 0 status register (0x40323)
Ch. 1 status: single-master I
2 C-bus Ch. 1 status register (0x40333)
Transfer errors
Transfer errors are reflected in the bits in the error status register.
Table 9.4
Error Status Register
Error status
Register
RACKx: Receive ACK signal
(D4) / Single-master I
2C-bus Ch. 0 error status register (0x40324)
(D4) / Single-master I
2C-bus Ch. 1 error status register (0x40334)
CMSx: Clock mismatch
(D3) / Single-master I
2C-bus Ch. 0 error status register (0x40324)
(D3) / Single-master I
2C-bus Ch. 1 error status register (0x40334)
DMSx: Data mismatch
(D2) / Single-master I
2C-bus Ch. 0 error status register (0x40324)
(D2) / Single-master I
2C-bus Ch. 1 error status register (0x40334)
SPDx: Stop condition
(D1) / Single-master I
2C-bus Ch. 0 error status register (0x40324)
(D1) / Single-master I
2C-bus Ch. 1 error status register (0x40334)
STDx: Start condition
(D0) / Single-master I
2C-bus Ch. 0 error status register (0x40324)
(D0) / Single-master I
2C-bus Ch. 1 error status register (0x40334)