TMP91C824
91C824-130
(9) Transmission
Buffer
The Transmission Buffer (SC0BUF) shifts out and sends the transmission data written from the
CPU form the least significant bit (LSB) in order. When all the bits are shifted out, the
Transmission Buffer becomes empty and generates an INTTX0 interrupt.
(10) Parity control circuit
When SC0CR<PE> in the Serial Channel Control Register is set to 1, it is possible to transmit and
receive data with parity. However, parity can be added only in 7-Bit UART Mode or 8-Bit UART
Mode. The SC0CR<EVEN> field in the Serial Channel Control Register allows either even or odd
parity to be selected.
In the case of transmission, parity is automatically generated when data is written to the
Transmission Buffer SC0BUF. The data is transmitted after the parity bit has been stored in
SC0BUF<TB7> in 7-Bit UART Mode or in SC0MOD0<TB8> in 8-Bit UART Mode. SC0CR<PE>
and SC0CR<EVEN> must be set before the transmission data is written to the Transmission Buffer.
In the case of receiving, data is shifted into Receiving Buffer 1, and the parity is added after the data
has been transferred to Receiving Buffer 2 (SC0BUF), and then compared with SC0BUF<RB7> in
7-Bit UART Mode or with SC0CR<RB8> in 8-Bit UART Mode. If they are not equal, a Parity error
is generated and the SC0CR<PERR> flag is set.
(11) Error flags
Three error flags are provided to increase the reliability of data reception.
1.
Overrun error <OERR>
If all the bits of the next data item have been received in Receiving Buffer 1 while valid data
still remains stored in Receiving Buffer 2 (SC0BUF), an Overrun error is generated.
The below is a recommended flow when the overrun-error is generated.
(INTRX interrupt routine)
1) Read receiving buffer
2) Read error flag
3) If <OERR>=1
then
4) Set to disable receiving (write ‘0’ to SC0MOD0<RXE>)
5) Wait to terminate current frame
6) Read receiving buffer
7) Read error flag
8) Set to enable receiving (write ‘1’ to SC0MOD0<RXE>)
9) Request to transmitt again
10) Other
2.
Parity error <PERR>
The parity generated for the data shifted into Receiving Buffer 2 (SC0BUF) is compared
with the parity bit received via the RXD pin. If they are not equal, a Parity error is generated.
3.
Framing error <FERR>
The stop bit for the received data is sampled three times around the center. If the majority of
the samples are 0, a Framing error is generated.