![IXYS zilog Z51F6412 Скачать руководство пользователя страница 102](http://html1.mh-extra.com/html/ixys/zilog-z51f6412/zilog-z51f6412_manual_2098946102.webp)
Z51F6412
Product Specification
PS030302-0212
P R E L I M I N A R Y
99
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.7.8 USART Transmitter
The USART Transmitter is enabled by setting the TXE bit in UCTRLx1 register. When the
Transmitter is enabled, the normal port operation of the TXD pin is overridden by the serial output pin
of USART. The baud-rate, operation mode and frame format must be setup once before doing any
transmissions. If synchronous or spi operation is used, the clock on the XCK pin will be overridden
and used as transmission clock. If USART operates in spi mode, SS pin is used as SS input pin in
slave mode or can be configured as SS output pin in master mode. This can be done by setting
SPISS bit in UCTRLx3 register.
11.7.8.1 Sending Tx data
A data transmission is initiated by loading the transmit buffer (UDATAx 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 at the settings of control registers. If the 9-bit
characters are used in asynchronous or synchronous operation mode (USIZE[2:0]=7), the ninth bit
must be written to the TX8 bit in UCTRLx3 register before loading transmit buffer (UDATA register).
11.7.8.2 Transmitter flag and interrupt
The USART Transmitter has 2 flags which indicate its state. One is USART Data Register Empty
(UDRE) and the other is Transmit Complete (TXC). Both flags can be interrupt sources.
UDRE 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 that 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 (UDRIE) bit in UCTRLx2 register is set and the
Global Interrupt is enabled, USART Data Register Empty Interrupt is generated while UDRE flag is set.
The Transmit Complete (TXC) flag bit is set when the entire frame in the transmit shift register has
been shifted out and there are no more data in the transmit buffer. The TXC flag is automatically
cleared when the Transmit Complete Interrupt service routine is executed, or it can be cleared by
writing ‘0’ to TXC bit in UCTRLx2 register.
When the Transmit Complete Interrupt Enable (TXCIE) bit in UCTRLx2 register is set and the Global
Interrupt is enabled, USART Transmit Complete Interrupt is generated while TXC flag is set.