UART external loopback interrupt

This example demonstrates UART communication using interrupt-driven transmit and receive operations. The application configures two UART instances (transmitter and receiver) and performs an external loopback test where data sent from one UART instance is received by the other. The transfer uses interrupts to manage the data flow, including TX, RX, and timeout interrupts.

Example Usage

  1. Connect the UART pins as described in the External Connections table.

  2. Build and run the example after connecting to the device.

  3. The application initializes both UART instances with:

    • 115200 baud rate

    • FIFO enabled

    • Interrupt-driven operation

  4. The transmitter sends 128 bytes of test data (sequential values 1-128).

  5. The receiver collects the data using interrupts.

  6. Line timeout interrupts help detect when transmission is complete.

  7. The application verifies that the received data matches the transmitted data.

  8. The example indicates success or failure via console output.

Key features demonstrated:

  • UART configuration with FIFOs

  • Interrupt-driven UART transfers

  • Handling of TX, RX, and timeout interrupts

  • External loopback validation of UART communication

External connections

Transmitter

Receiver

UC0 TX (PA22)

UC1 RX (PA9)

UC0 RX (PA23)

UC1 TX (PA10)