ST AN2800 Application note STM8A UART emulator handbook

Update: 29 September, 2023

This application note describes a technique to emulate the universal asynchronous receiver transmitter (UART) hardware peripheral, through the microcontroller medium end timer (TIMER3), without the use of additional hardware. TIMER3 was chosen for this purpose because its capture and compare features can be easily used to receive and transmit data in a non return to zero (NRZ) serial format. This timer also provides a necessary time reference to establish when to send and read each outgoing and incoming data frame bit. In addition, TIMER3 was chosen because it has all the necessary features to build a software UART. Features include two timer channels, one for transmission (TIMER3_CC2) and one for reception (TIMER3_CC1). The input capture feature of channel one allows detection of an incoming data frame start bit, whereas its compare feature indicates when the bits have to be read. The output compare feature of channel two allows transmission of a data frame. The algorithm described in this document is an example which can be further customized and improved. It is explained in Section 7: The UART emulator software algorithm on page 14, together with information on how to configure and use a UART emulator. The algorithm handles several UART hardware features via software such as, selection of the operating mode, noise and frame error detection, programmable data word length and configurable stop


File format: PDF

Size: -

MD5 Checksum: 879DFAB74E16AAF957C3D2C9D9A84386

Publication date: 07 August, 2012

Downloads: -

PDF Link: ST AN2800 Application note STM8A UART emulator handbook PDF

Also Manuals