1 FlexIO introduction
This application note illustrates how to use FlexIO module to emulate UART
based on RT1010. Although RT1010 has four LPUART, FLEXIO simulation is
also an option when the number of LPUART is not enough.
FlexIO is an on-chip peripheral available on NXP I.MXRT series. It is a highly configurable module which is capable of emulating
a wide range of communication protocols, such as UART, I
2
C,SPI, I
2
S, and so on. Users can also use FlexIO to generate PWM
and PFM waveform.
2 UART based on FLEXIO
2.1 UART overview
A universal asynchronous receiver/transmitter is a piece of computer hardware that translates data between parallel and serial
forms. UARTs are commonly used in conjunction with communication standards such as EIA, RS-232, RS-422 or RS-485. The
universal designation indicates that the data format and transmission speeds are configurable. The electric signaling levels and
methods (such as differential signaling etc.) are handled by a driver circuit external to the UART. A UART is usually an individual
(or part of an) integrated circuit used for serial communications over a computer or peripheral device serial port.
Transmitting and receiving UARTs must be set for the same bit speed, character length, parity and stop bits for proper operation.
The receiving UART may detect some mismatched settings and set a framing error flag bit for the host system. Figure 1 shows
a typical UART 8-bit data frame.
Figure 1. UART 8-bit data frame
2.2 UART with FlexIO
When FlexIO is used to simulate the UART, pay attention to the advantages and disadvantages in order to allocate resources
reasonably.
Advantages:
Increase the number of UARTs.
Contents
1 FlexIO introduction.................................1
2 UART based on FLEXIO....................... 1
3 Summary .............................................. 6
AN12772
Emulating UART with the FlexIO on RT1010
Rev. 0 — March 10 2020
Application Note
High baud rate.
Flexible configuration, can configure the number of bits of data in a frame.
Disadvantages:
Does not support parity.
Does not support FIFO, recommended for high-speed processing with DMA.
Composition of FLEXIO Shifter and Timer. Shift Registers with transmit, receive and data match modes. For UART case, shifter
works under Transmit or Received mode. Besides this, shifter supports Start/Stop bit generation. Timer supports variety of
internal/external trigger and enable/disable/reset/decrement conditions.
Timer has three operating modes:
Dual 8-bit baud mode
Dual 8-bit PWM mode
Single 16 bit mode
For the UART case, the timer works in the Dual 8 bit baud mode.
Figure 2. Timer operating modes
Figure 3 shows a simple UART data transmitting and receiving process.
The process for the transmitting process includes:
1. The data are stored in the SHIFTBUFi.
2. The data are loaded to the SHIFTERi.
3. The data are sent to output pin triggered by timer and clock.
The process for the receiving process include:
1. The input data get from FLEXIO input pin.
2. The input data trigger the timer and are stored to the SHIFTERi.
3. The inpit data are output to the SHIFTBUFi.
NXP Semiconductors
UART based on FLEXIO
Emulating UART with the FlexIO on RT1010, Rev. 0, March 10 2020
Application Note 2 / 7