Download Print this page

Renesas M16C/50 Series User Manual page 518

Advertisement

M16C/5L Group, M16C/56 Group
UART2 Transmit Buffer Register (UiTB)
b15
Figure 21.25 UiTB Register Setting (SDA Input)
SCL
- ACK
(Receiver)
SDA
U2TB register ← 00FFh
- NACK
(Receiver)
SDA
U2TB register ← 01FFh
Figure 21.26 Byte Data Reception
21.3.3.9
ACK and NACK
When data is to be received, ACK is output after 8 bits are received by setting the U2TB register to
00FFh as dummy data. When the STSPSEL bit in the U2SMR4 register 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
SDA2 pin.
If the IICM2 bit is 0, a NACK interrupt request is generated when the SDA2 pin is held high at the rising
edge of the ninth bit of SCL2. An ACK interrupt request is generated when the SDA2 pin is held low.
If the DMA request source is "UART2 receive interrupt request or ACK interrupt request", the DMA
transfer is activated when ACK is detected.
21.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 U2SMR2 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 U2TB register value is transferred to the transmit
shift register. Doing so starts the data transmission when the next clock pulse is applied. However,
the UART2 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 SCL2 pin low after the eighth bit of SCL2 is received).
Consequently, the SCL2 pin is pulled low at the falling edge of the ninth clock pulse.
When UART2 transmission/reception is started using this function, the TI bit does not change.
When the UART2 initializing function is used in slave mode, UART2 is initialized automatically when a
start condition is detected. Therefore, an interrupt is unnecessary for detecting a start condition.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
b8 b7
1
1
1 1
1
1
2
3
4
Released (Hi-Z)
Released (Hi-Z)
21. Serial Interface UARTi (i = 0 to 4)
b0
1 1
1
Set these bits to 1 to release the SDA2 pin
0: ACK generated
1: NACK generated
5
6
7
8
9
ACK generated (low-level)
NACK generated (Hi-Z)
Page 481 of 803

Advertisement

loading