R01UH0092EJ0110 Rev.1.10
Page 502 of 807
Jul 31, 2012
M16C/64C Group
23. Serial Interface UARTi (i = 0 to 2, 5 to 7)
Figure 23.30 UiTB Register Setting (SDA Input)
Figure 23.31 Byte Data Reception
23.3.3.9
ACK and NACK
When data is to be received, ACK is output after 8 bits are received by setting the UiTB register to
00FFh as dummy data. When the STSPSEL bit in the UiSMR4 register (i = 0 to 2, 5 to 7) is set to 0
(serial I/O circuit selected) and the ACKC bit is set to 1 (ACK data output), the value of the ACKD bit is
output at the SDAi pin.
If the IICM2 bit is 0, a NACK interrupt request is generated when the SDAi pin is held high at the rising
edge of the ninth bit of SCLi. An ACK interrupt request is generated when the SDAi pin is held low.
If the DMA request source is “UARTi receive interrupt request or ACK interrupt request”, the DMA
transfer is activated when ACK is detected.
23.3.3.10 Initialization of Transmission/Reception
Select the external clock as the transmit/receive clock when using this function.
If a start condition is detected while the STAC bit in the UiSMR2 register is 1 (initialize the circuit if the
start condition is detected), the serial interface operates as follows:
•
The transmit shift register is initialized, and the UiTB register value is transferred to the transmit shift
register. Doing so starts the data transmission when the next clock pulse is applied. However, the
UARTi output value does not change until the first bit of data is output synchronously with the input
clock. It remains the same as when a start condition was detected.
•
The receive shift register is initialized, and the serial interface starts receiving data when the next
clock pulse is applied.
•
The SWC bit becomes 1 (hold the SCLi pin low after the eighth bit of SCLi is received).
Consequently, the SCLi pin is pulled low at the falling edge of the ninth clock pulse.
When UARTi transmission/reception is started using this function, the TI bit does not change.
When the UARTi initializing function is used in slave mode, UARTi is initialized automatically when a
start condition is detected. Therefore, an interrupt is unnecessary for detecting a start condition.
b15
b8 b7
b0
1
1
1 1
1
1 1
1
0: ACK generated
1: NACK generated
UARTi Transmit Buffer Register (UiTB)
Set these bits to 1 to release the SDAi pin
SCL
(Receiver)
SDA
ACK generated (low-level)
1
NACK generated (Hi-Z)
Released (Hi-Z)
- ACK
- NACK
(Receiver)
SDA
2
3
4
5
6
7
8
Released (Hi-Z)
9
UiTB register
←
00FFh
UiTB register
←
01FFh
Summary of Contents for M16C Series
Page 846: ...M16C 64C Group R01UH0092EJ0110...