Universal Asynchronous Receiver Transmitter (UART) eTPU Function
The UART function uses two eTPU channels to provide
a 3-wire (TxD, RxD, and GND) asynchronous serial
interface. It can be used to add serial capability to a
device without a serial port, or to add additional serial
I/O to a device which already has a hardware UART. The
function requires no host CPU intervention during data
frame transmission or reception. One eTPU channel is
configured to function as the serial transmitter (TxD),
and another eTPU channel is configured to function as a
serial receiver (RxD). The function configures channels
in pairs assuming that there is both transmit and receive
channels. Both the transmit and receive channels have
the same attributes in terms of baud-rate, data-size, parity
etc. However, any channel can be assigned as the transmit
channel, and any other channel can be assigned as the receive
channel. Standard baud rates and non-standard baud rates,
in addition to parity checking can be selected.
The main features of the function are as follows:
- Any channel configurable as either a transmitter or a receiver
- Channels assigned in pairs, in which two channels must be utilized for a fully functional UART,
containing both a transmitter and a receiver
- Programmable baud rate period over a 23-bit range of TCR1 counts
- Variable data word size from 1 to 23 bits
- Programmable parity
- Double buffered data, both transmitter and receiver contain a shift register, and a data register
- A transmitter channel sets the channel interrupt status (CIS) flag and the data transfer request
status (DTRS) flag to indicate when data has been transferred from the data register to the shift
register, indicating that the data register is available to receive new data to be transmitted.
- A receiver channel sets the channel interrupt status (CIS) flag and the data transfer request status
(DTRS) flag to indicate when data has been transferred from the receive shift register to the
receive data register, indicating new receive data is available to be read by the host.
- Supports back-to-back transfers. If data is available in time, the transmitter does not generate an
idle signal, but transmits exactly 1 stop bit, followed by the start bit for the next data word.
- Auto baud rate detection and hardware flow control (Xon, Xoff) are not supported.
- The hardware handshake signals CTS and RTS are not available. However the CIS/ DTRS flags
in channels configured to transmit and receive can be used to emulate that functionality.
For full description refer to AN2853.