R01UH0136EJ0210 Rev.2.10
Page 507 of 800
Jul 31, 2012
M16C/64A Group
23. Serial Interface UARTi (i = 0 to 2, 5 to 7)
23.3.6
Special Mode 4 (SIM Mode) (UART2)
In this mode, the serial interface module allows SIM interface devices to communicate in UART mode.
Both direct and inverted formats are available. The TXD2 pin outputs a low-level signal when a parity
error is detected.
Table 23.24 lists the specifications of SIM mode. Table 23.25 lists the related registers and their
settings.
Notes:
1.
If an overrun error occurs, the received data of the U2RB register will be undefined. The IR bit in the
S2RIC register does not change.
2.
After reset, a transmit interrupt request is generated by setting bits U2IRS and U2ERE in the U2C1
register to 1 (transmission completed, error signal output), then setting the TE bit to 1 (transmission
enabled) and the transmission data to the U2TB register. Therefore, when using SIM mode, make
sure to set the IR bit to 0 (interrupt not requested) after setting these bits.
3.
The timing at which the framing error flag and the parity error flag are set is detected when data is
transferred from the UART2 receive register to the U2RB register.
Table 23.24
SIM Mode Specifications
Item
Specification
Data formats
•
Direct format
•
Inverted format
Transmit/receive clock
•
The CKDIR bit in the U2MR register is 0 (internal clock): fi/(16(n + 1))
fi = f1SIO, f2SIO, f8SIO, f32SIO
n = setting value of the U2BRG register 00h to FFh
•
The CKDIR bit is 1 (external clock): fEXT/(16(n + 1))
fEXT = input from the CLK2 pin
n = setting value of the U2BRG register 00h to FFh
Transmission start
conditions
To start transmission, satisfy the following requirements:
•
The TE bit in the U2C1 register is 1 (transmission enabled)
•
The TI bit in the U2C1 register is 0 (data present in the U2TB register)
Reception start
conditions
To start reception, satisfy the following requirements:
•
The RE bit in the U2C1 register is 1 (reception enabled)
•
Start bit detection
Interrupt request
generation timing
(2)
•
While transmitting
When the serial interface completes transmitting data from the UART2
transmit register (the U2IRS bit is 1)
•
While receiving
When transferring data from the UART2 receive register to the U2RB register
(at completion of reception)
Error detection
•
Overrun error
(1)
This error occurs if the serial interface starts receiving the next data before
reading the U2RB register and receives the bit before the last stop bit of the
next data.
•
Framing error
(3)
This error occurs when the number of stop bits set is not detected.
•
Parity error
(3)
During reception, if a parity error is detected, a parity error signal is output from
the TXD2 pin.
During transmission, a parity error is detected by the level of input to the RXD2
pin when a transmission interrupt occurs.
•
Error sum flag
This flag becomes 1 when an overrun, framing, or parity errors occurs.
Содержание M16C/60 Series
Страница 853: ...M16C 64A Group R01UH0136EJ0210...