Texas Instruments MSP430x1xx User Manual

Page 228

Advertising
background image

Interrupt and Enable Functions

12-12

12.4.2 USART Transmit Enable Bit

The transmit enable bit UTXE, shown in Figure 12–13, enables or disables a
character transmission on the serial-data line. If this bit is reset, the transmitter
is disabled but any active transmission does not halt until the data in the
transmit shift register and the transmit buffer are transmitted. Data written to
the transmit buffer before UTXE has been reset may be modified or
overwritten—even after UTXE is reset—until it is shifted to the transmit shift
register. For example, if software writes a byte to the transmit buffer and then
resets UTXE, the byte written to the transmit buffer will be transmitted and may
be modified or overwritten until it is transferred into the transmit shift register.
However, after the byte is transferred to the transmit shift register, any
subsequent writes to UTXBUF while UTXE is reset will not result in
transmission, but UTXBUF will be updated with the new value.

Figure 12–13. State Diagram of Transmitter Enable

Idle State

(Transmitter

Enabled)

Transmit

Disable

Transmission

Active

UTXE = 0

No Data Written
to Transmit Buffer

Not Completed

UTXE = 1

UTXE = 0

UTXE = 1

Data Written to

Transmit Buffer

Handle Interrupt
Conditions

Character
Transmitted

UTXE = 1

UTXE = 0 And Last Buffer
Entry Is Transmitted

When UTXE is reset and the current transmission is completed, new data
written to the transmit buffer will not be transmitted. Once the UTXE bit is set,
the data in the transmit buffer are immediately loaded into the transmit shift
register and character transmission is started.

Note:

Writing to UTXBUF, UART Mode

Data should never be written to transmit buffer UTXBUF when the buffer is
not ready and when the transmitter is enabled (UTXE is set). Otherwise, the
transmission will have errors.

Note:

Write to UTXBUF/Reset of Transmitter, UART Mode

Disabling the transmitter should be done only if all data to be transmitted has
been moved to the transmit shift register.

MOV.B

#....,&UTXBUF

BIC.B

#UTXE,&ME2

; If BITCLK < MCLK then the

; transmitter might be stopped

; before the buffer is loaded

; into the transmitter shift

; register

Advertising