Renesas M16C/64A Series User Manual page 533

Table of Contents

Advertisement

M16C/64A Group
UARTi Transmit Buffer Register (UiTB)
b15
Figure 23.30 UiTB Register Setting (SDA Input)
SCL
- ACK
(Receiver)
SDA
UiTB register ← 00FFh
- NACK
(Receiver)
SDA
UiTB register ← 01FFh
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.
R01UH0136EJ0210 Rev.2.10
Jul 31, 2012
b8 b7
1
1
1 1
1
1
2
3
4
Released (Hi-Z)
Released (Hi-Z)
23. Serial Interface UARTi (i = 0 to 2, 5 to 7)
b0
1 1
1
Set these bits to 1 to release the SDAi pin
0: ACK generated
1: NACK generated
5
6
7
8
9
ACK generated (low-level)
NACK generated (Hi-Z)
Page 500 of 800

Advertisement

Table of Contents
loading

Table of Contents