UART(Universal Asynchronous Receiver-Transmitter)
A UART(Universal Asynchronous Receiver-Transmitter) is a computer hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable. The electric signaling levels and methods are handled by a driver circuit external to the UART. A UART is usually an individual (or part of an) integrated circuit (IC) used for serial communications over a computer or peripheral device serial port.
Let us write and implement a test program for a UART.
Step 1: Create a uart.c File
Step 2: Write the following code into the File
Step 3: Open Terminal and navigate to your Toolchain folder
Step 4: Run the "env.sh" file using the command . env.sh
to enable the Toolchain
To make sure the toolchain is runnig type in "arm" and hit the <TAB> key twice.
Step 5: To create a binary named uart from "uart.c"
arm-linux-gnueabi-gcc uart.c -o uart
Step 6: Transfer the compiled binary to the Board using TFTP or SD card.
Step 7: Run the binary file sudo ./uart
on the Board's Terminal.
Last updated