1 |
2 |
zpekic |
# Simple UART for FPGA
|
2 |
|
|
|
3 |
|
|
Simple UART for FPGA is UART (Universal Asynchronous Receiver & Transmitter) controller for serial communication with an FPGA. The UART controller was implemented using VHDL 93 and is applicable to any FPGA.
|
4 |
|
|
|
5 |
|
|
**Simple UART for FPGA requires: 1 start bit, 8 data bits, 1 stop bit!**
|
6 |
|
|
|
7 |
|
|
The UART controller was simulated and tested in hardware.
|
8 |
|
|
|
9 |
|
|
# Table of inputs and outputs ports:
|
10 |
|
|
|
11 |
|
|
Port name | IN/OUT | Width | Port description
|
12 |
|
|
---|:---:|:---:|---
|
13 |
|
|
CLK | IN | 1b | System clock.
|
14 |
|
|
RST | IN | 1b | High active synchronous reset.
|
15 |
|
|
UART_TXD | OUT | 1b | Serial transmit data.
|
16 |
|
|
UART_RXD | IN | 1b | Serial receive data.
|
17 |
|
|
DATA_IN | IN | 8b | Data byte for transmit.
|
18 |
|
|
DATA_SEND | IN | 1b | Send data byte for transmit.
|
19 |
|
|
BUSY | OUT | 1b | Transmitter is busy, can not send next data.
|
20 |
|
|
DATA_OUT | OUT | 8b | Received data byte.
|
21 |
|
|
DATA_VLD | OUT | 1b | Received data byte is valid.
|
22 |
|
|
FRAME_ERROR | OUT | 1b | Stop bit is invalid, data may be corrupted.
|
23 |
|
|
|
24 |
|
|
# Table of generics:
|
25 |
|
|
|
26 |
|
|
Generic name | Type | Default value | Generic description
|
27 |
|
|
---|:---:|:---:|:---
|
28 |
|
|
CLK_FREQ | integer | 50e6 | System clock.
|
29 |
|
|
BAUD_RATE | integer | 115200 | Baud rate value.
|
30 |
|
|
PARITY_BIT | string | "none" | Type of parity: "none", "even", "odd", "mark", "space".
|
31 |
|
|
USE_DEBOUNCER | boolean | True | Use debounce?
|
32 |
|
|
|
33 |
|
|
# Table of resource usage summary:
|
34 |
|
|
|
35 |
|
|
Use debouncer | Parity type | LE (LUT+FF) | LUT | FF | BRAM | Fmax
|
36 |
|
|
:---:|:---:|:---:|:---:|:---:|:---:|:---:
|
37 |
|
|
True | none | 77 | 64 | 55 | 0 | 202.2 MHz
|
38 |
|
|
True | even/odd | 82 | 75 | 58 | 0 | 162.5 MHz
|
39 |
|
|
True | mark/space | 80 | 68 | 58 | 0 | 184.5 MHz
|
40 |
|
|
False | none | 72 | 59 | 50 | 0 | 182.7 MHz
|
41 |
|
|
False | even/odd | 77 | 70 | 53 | 0 | 155.6 MHz
|
42 |
|
|
False | mark/space | 75 | 62 | 53 | 0 | 200.8 MHz
|
43 |
|
|
|
44 |
|
|
*Synthesis was performed using Quartus II 64-Bit Version 13.0.1 for FPGA Altera Cyclone II with enable force use of synchronous clear. Setting of some generics: BAUD_RATE = 115200, CLK_FREQ = 50e6.*
|
45 |
|
|
|
46 |
|
|
# License:
|
47 |
|
|
|
48 |
|
|
This UART controller is available under the MIT license (MIT). Please read [LICENSE file](LICENSE).
|