Fujitsu FR81S User Manual

Page of 2342
CHAPTER 40: MULTI-FUNCTION SERIAL INTERFACE 
 
 
8. Operation of I2C 
 
FUJITSU SEMICONDUCTOR LIMITED 
CHAPTER : MULTI-FUNCTION SERIAL INTERFACE 
FUJITSU SEMICONDUCTOR CONFIDENTIAL 
356 
 
8.3.5. Data Reception by Master 
 When DMA mode is disable (SSR:DMA=0) 
If the data direction bit (R/W) is "1", data sent from the slave device will be received. 
When FIFO operation is disabled, the master device operation is as follows: 
 
If the SSR:TDRE bit is "1", the master device will generate a wait (IBCR:INT="1", SSR:RDRF="1") 
each time it receives 1 byte of data. At this time when IBCR:WSEL bit is "1" means before a wait and 
when IBCR:WSEL bit is "0" means after a wait, the master device responds with ACK or NACK by 
the ACKE bit setting of IBCR register. 
 
If the SSR:TDRE bit is "0" and if the ACKE bit setting of IBCR register is responded with ACK, no 
wait will be generated (IBCR:INT="0") and the next data will be received. If responded with NACK, a 
wait is generated (IBCR:INT="1"). 
 
If FIFO operation is enabled, the SSR:RDRF bit is set to "1" when the same number of bytes as the received 
data bytes is received. The interrupt flag is set to "1" if the SSR:TDRE bit is "1", and the I
2
C bus is waited. 
At this time the ACK will operate as follows. The data will be stored in the reception FIFO as received data 
even if NACK is output. 
 
When IBCR:WSEL="0" and the SSR:TDRE bit is set to "1", a NACK response will be made when 
received a NACK even if the setting is for ACKE. 
 
When IBCR:WSEL = "1", the interrupt flag is set to "1" and a wait is generated after the last byte is 
received. Set the IBCR:ACKE bit during the wait, and then the ACK or NACK response is performed 
according to the setting for the IBCR:ACKE bit once the interrupt flag is cleared to "0". 
 
The following explains the waiting by interrupt. 
 
Table 8-7 WSEL Bit when Master Data is Received 
WSEL 
Operation 
In the 2nd or subsequent byte, the interrupt flag bit (IBCR:INT) is set to "1" and SCL is set to 
"L" to go into the wait state when the SSR:TDRE bit is "1" after the acknowledgment. 
In the 2nd or subsequent byte, the interrupt flag bit (IBCR:INT) will be set to "1" and SCL will 
be set to "L" to go into the wait state when the SSR:TDRE bit is "1"after the master receives 1 
byte data. 
 
The following gives an example of procedure to receive data from the slave device. 
 
If the receive FIFO operation is disabled. 
(1)  Set the slave address (including the data direction bit) in the TDR register, and set the IBCR:MSS bit to "1". 
(2)  Transmit the slave address and receive ACK. The interrupt flag (IBCR:INT) becomes "1". 
(3)  Update the IBCR:WSEL bit and set the interrupt flag bit (IBCR:INT) to "0" to release the I
2
C bus from waiting 
state. 
(4)  Put the I
2
C bus in a wait by setting the interrupt flag to "1", after transmitting an acknowledge upon the reception 
of one byte when IBCR:WSEL is set to "0", or immediately after one byte has been received when IBCR:WSEL is 
set to "1". Repeat Steps (3) to (4) until the specified number of data sets are received. 
(5)  After reception of the last data, send a NACK response, set the IBCR:MSS bit to "0" or set the IBCR:SCC bit to 
"1" in order to generate a stop condition or a repeated start condition. 
MB91520 Series
MN705-00010-1v0-E
1669