The attached code can be used as a reference to test UART connections on newly designed board with ADSP SC58x/ ADSP-2158x processors.
The code does the following:
- This code intends to test the DMA data transfer mode of the UART module in auto-buffer mode.
- It configures the UART in UART mode of operation for data transfer. The data transfer is through auto-buffered DMA flow mode.
- The code tests for two types of data patterns:
- Fixed data pattern as 0xAA: This is to check whether the UART transmit data comes out well when the UART Transmitter channel is probed using a scope.
- Random data: This is to make sure that the transmitted data is received properly when routed back to the UART configured as receiver.
- Appropriate connections should be made externally based on the TX and RX choice. Connect the appropriate UARTx TX and UARTx RX pins externally.
How to modify the code for customized system requirements:
- The existing code provides the flexibility to configure any of the UARTs as the transmitter and the receiver.
- The existing code uses UART0 configured as transmitter and as receiver. The UARTs used can be modified to any other combination of UARTs. (See screenshot below)
- Various configurations for baud rates have also been defined as macros.
How to test that the code works?
- To make sure that the UART signals are coming out on the pins as expected, probe the UART Tx pin. To make sure that a known data (e.g. 0xAA as byte of the frame in this case) is transferred for easy probing, use the definition “Fixed_data”(see below screenshot)
The below screenshot shows how the signals should look like when UART TX pin is probed.
- For a quick sanity check that the UART receiver is able to receive the data as expected, one can look at compare the transmit and receive data (in random data format) by looking at the CCES memory window as shown in the screenshot below: