190
MC96F6432A
ABOV Semiconductor Co., Ltd.
11.12.8 USIn UART 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 St + bits 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.9 USIn UART Transmitter
The UART transmitter is enabled by setting the TXEn bit in USInCR2 register. When the Transmitter is enabled, the
TXDn pin should be set to TXDn function for the serial output pin of UART by the P4FSR[3:2] and P2FSRL[1:0].The
baud-rate, operation mode and frame format must be set up once before doing any transmission. In synchronous
operation mode, the SCKn pin is used as transmission clock, so it should be selected to do SCKn function by
P4FSR[5:4] and P2FSRL[3:2].
11.12.9.1
USIn UART Sending TX data
A data transmission is initiated by loading the transmit buffer (USInDR register I/O location) with the data to be
transmitted. The data be 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 in asynchronous or synchronous
operation mode, the ninth bit must be written to the USInTX8 bit in USInCR3 register before it is loaded to the transmit
buffer (USInDR register).
11.12.9.2
USIn UART Transmitter flag and interrupt
The USART transmitter has two flags which indicate its state. One is USART data register empty flag (DREn) and the
other is transmit completion flag (TXCn). Both flags can be used as interrupt sources.
DREn 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 transmission data which 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 not valid.
When the data register empty interrupt enable (DRIEn) bit in USInCR2 register is set and the global interrupt is
enabled, USInST1 status register empty interrupt is generated while DREn 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 serve routine is executed or it can be cleared by writing
‘0’ to TXCn bit in USInST1 register.
When the transmit complete interrupt enable (TXCIEn) bit in USInCR2 register is set and the global interrupt is
enabled, UART transmit complete interrupt is generated while TXCn flag is set.
Содержание MC96F6332A
Страница 16: ...16 MC96F6432A ABOV Semiconductor Co Ltd 4 Package Diagram Figure 4 1 48 Pin QFN Package ...
Страница 17: ...17 MC96F6432A ABOV Semiconductor Co Ltd Figure 4 2 44 Pin MQFP Package ...
Страница 18: ...18 MC96F6432A ABOV Semiconductor Co Ltd Figure 4 3 32 Pin LQFP Package ...
Страница 19: ...19 MC96F6432A ABOV Semiconductor Co Ltd Figure 4 4 32 Pin SOP Package ...
Страница 20: ...20 MC96F6432A ABOV Semiconductor Co Ltd Figure 4 5 28 Pin SOP Package ...