240
MC97F60128
ABOV Semiconductor Co., Ltd.
11.12.5 Parity bit
The parity bit is calculated by doing an exclusive-OR of all the data bits. If odd parity is used, the result of the
exclusive-or is inverted. The parity bit is located between the MSB and first stop bit of a serial frame.
P
even
= D
n-1
^ … ^ D
3
^ D
2
^ D
1
^ D
0
^ 0
P
odd
= D
n-1
^ … ^ D
3
^ D
2
^ D
1
^ D
0
^ 1
P
even
: Parity bit using even parity
P
odd
: Parity bit using odd parity
D
n
: Data bit n of the character
11.12.6 UART2/3/4 Transmitter
The UART2/3/4 transmitter is enabled by setting the TXEn bit in UARTnCR2 register.
When the Transmitter is enabled,
the TXDn pin should be set to TXDn function for the serial output pin of UART2/3/4 by the
P6FSRH[1:0]/P5FSRL[5:4]/P5FSRL[2:1].
The baud-rate, operation mode and frame format must be setup once before
doing any transmission.
11.12.7 Sending Tx data
A data transmission is initiated by loading the transmit buffer (UARTnDR register I/O location) with the data to be
transmitted. The data written in transmit buffer is moved to the shift register when the shift register is ready to send a
new frame. The shift register is loaded with the new data if it is in idle state or immediately after the last stop bit of the
previous frame is transmitted. When the shift register is loaded with new data, it will transfer one complete frame
according to the settings of control registers.
If the 9-bit characters are used, the ninth bit must be written to the UnTX8
bit in UARTnCR3 register before it is loaded to the transmit buffer (UARTnDR register).
11.12.8 Transmitter flag and interrupt
The UART2/3/4 transmitter has 2 flags which indicate its state.
One is UART2/3/4 data register empty flag (UDREn)
and the other is transmit complete flag (TXCn). Both flags can be interrupt sources.
UDREn flag indicates whether the transmit buffer is ready to receive new data. This bit is set when the transmit buffer
is empty and cleared when the transmit buffer contains data to be transmitted but has not yet been moved into the
shift register. And also this flag can be cleared by writing
‘0’ to this bit position. Writing ‘1’ to this bit position is
prevented.
When the data register empty interrupt enable (UDRIEn) bit in UARTnCR2 register is set and the global interrupt is
enabled, UART2/3/4 data register empty interrupt is generated while UDREn flag is set.
The transmit complete (TXCn) flag bit is set when the entire frame in the transmit shift register has been shifted out
and there is no more data in the transmit buffer. The TXCn flag is automatically cleared when the transmit complete
interrupt service routine is executed or it can be cleared by writing
‘0’ to TXCn bit in UARTnST register.
When the transmit complete interrupt enable (TXCIEn) bit in UARTnCR2 register is set and the global interrupt is
enabled,
UART2/3/4 transmit complete interrupt is generated while TXCn flag is set.
Содержание MC97F60128
Страница 17: ...17 MC97F60128 ABOV Semiconductor Co Ltd 4 Package Diagram Figure 4 1 100 pin LQFP 1414 Package...
Страница 18: ...18 MC97F60128 ABOV Semiconductor Co Ltd Figure 4 2 80 Pin LQFP 1212 Package...
Страница 19: ...19 MC97F60128 ABOV Semiconductor Co Ltd Figure 4 3 80 Pin LQFP 1414 Package...
Страница 20: ...20 MC97F60128 ABOV Semiconductor Co Ltd Figure 4 4 64 Pin LQFP 1414 Package...