This application note describes a software implementation of a Universal Asynchronous Receiver/Transmitter (UART) that can be used on devices, like the ST7LITE0, with no on-chip SCI peripheral. In this example, a software UART is implemented for the ST7FLITE0, using the 12-bit Autoreload timer and two I/O ports for asynchronous receive and transmit. The UART software provides features such as half-duplex operation, asynchronous operation, flexible data formats (7 or 8 data bits, 1 or 2 stop bits), and baud rates ranging from 2400 to 19200 baud. The interrupt-driven software UART can be tested using the Hyperterminal application on a Windows PC. The program code is small (357 bytes) and can be easily adapted to specific application requirements.
This document details a software implementation of a Universal Asynchronous Receiver/Transmitter (UART) designed for ST7LITEO devices that lack an on-chip SCI peripheral. The solution utilizes the 12-bit autoreload timer and two I/O ports to handle asynchronous receive and transmit operations.
The application supports half-duplex and asynchronous operation with flexible data formats, including 7 or 8 data bits and 1 or 2 stop bits. Supported baud rates range from 2400 to 19200. The note provides configuration instructions for the ST7FLITEO, including clock source setup, input initialization, and timer register configuration, along with a functional software flow and test procedures.
| Supported Baud Rate | 2400 to 19200 baud |
|---|---|
| Data Bits | 7 or 8 data bits |
| Stop Bits | 1 or 2 stop bits |
| Operation Mode | Half-duplex |
| Clock Frequency | 8 MHz internal clock |
It is designed for devices like the ST7LITEO that have no on-chip SCI peripheral.
The program code is 357 bytes.
Pin PA3 is used for transmission and Pin PA7 is used for reception.