# UART Protocol # Understanding the UART Protocol UART (Universal Asynchronous Receiver-Transmitter) is a widely used asynchronous serial communication protocol for exchanging data between devices, such as FPGAs and computers. Unlike synchronous protocols, UART does not use a shared clock signal. Instead, data is sent at a predefined transmission rate (baud rate) agreed upon by both devices. Each transmitted byte includes: - **1 start bit** - **8 data bits** - **1 stop bit** During transmission, the data is sent bit by bit through the TX (transmit) line, while the receiving device reads these bits from the RX (receive) line, synchronizing with the established timing. Below is a placeholder for an image that illustrates how UART works (start bit, data bits, stop bit, idle state, etc.). # Creating Your Project in ChipInventor In this tutorial, you will create a serial communication system using UART with three main blocks: uart\_rx, uart\_logic\_const, and uart\_tx. When a character is received via UART, the system compares it with a predefined value and toggles an LED if it matches. ##### **Step-by-Step:** 1\. Open **ChipInventor**. 2\. Click on "**New Project**". 3\. Fill in the fields as follows: - **Name:** UART Communication FPGA - **Description:** UART system with RX, logic comparison, and TX - **Type:** FPGA 4\. Click "**Create**". # Blocks Used in the Project The project uses the following blocks based on the provided Verilog modules: - **uart\_rx:** Responsible for receiving data from the UART port and indicating when a byte has been completely received. - **uart\_logic\_const:** Compares the received byte with a predefined character and toggles an LED state. - **uart\_tx:** Sends data via the UART serial port. - **Input/Output Pins:** - clk: Main system clock - uart\_rx: UART data input - uart\_tx: UART data output - b0: Reset button - led0: Indicator LED **** # Connecting the Blocks Assemble the project with the following configuration: ##### **uart\_rx Block** - **Inputs:** - clk → system clock - uartRx → UART input pin - **Outputs**: - rxByte → connects to the logic block - byteReady → connects to both the logic block and uart\_tx ##### **uart\_logic\_const Block** - **Inputs**: - clk → system clock - rxByte → from rxByte output of uart\_rx - byteReady → from byteReady output of uart\_rx - compareChar → constant value (e.g., 8’h61 = 'a') - **Output**: - signal → connects to LED (led0) ##### **uart\_tx Block** - **Inputs:** - clk → clock - reset → button (b0) - tx\_data → receives rxByte from uart\_rx - tx\_data\_valid → receives byteReady from uart\_rx - **Output**: - tx\_pin → connects to the UART TX output pin - tx\_data\_ready → not used in this simple project  **Final Connections:**
Block/Pin | Connection |
clk | All blocks |
uart\_rx | UART RX input |
uart\_tx | UART TX output |
b0 | Reset signal for uart\_tx |
led0 | Output from signal of uart\_logic\_const |