MC97F2664
April 11, 2014 Ver. 1.4
169
11.10.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 P4FSR3/
P4FSR4/P2FSR3.
The baud-rate, operation mode and frame format must be setup once before doing any
transmission.
11.10.6.1 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.10.6.2 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.
Содержание MC97F2664
Страница 20: ...MC97F2664 20 April 11 2014 Ver 1 4 4 Package Diagram Figure 4 1 64 Pin LQFP 1010 Package...
Страница 21: ...MC97F2664 April 11 2014 Ver 1 4 21 Figure 4 2 64 Pin LQFP 1414 Package...
Страница 22: ...MC97F2664 22 April 11 2014 Ver 1 4 Figure 4 3 64 Pin QFN Package...
Страница 23: ...MC97F2664 April 11 2014 Ver 1 4 23 Figure 4 4 44 Pin MQFP 1010 Package...