GithubHelp home page GithubHelp logo

esearcher / fpga-uart-tx-rx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matt-alencar/fpga-uart-tx-rx

0.0 1.0 0.0 56 KB

Basic UART TX/RX module for FPGA

License: MIT License

Verilog 100.00%

fpga-uart-tx-rx's Introduction

Basic UART TX/RX module for FPGA

A simple UART TX/RX module implemented using Verilog HDL for FPGA

How it works

The UART TX/RX module is internally projected to work with any baud rate of user choice. That has to be done through module instantiation parameters:

TICKS_PER_BIT       : Number of clock ticks for a bit time (ticks per bit = system clock / baud rate)
TICKS_PER_BIT_SIZE  : Number of bits to hold TICKS_PER_BIT value, usually obtained using $bits(TICKS_PER_BIT);

Note that the baud rate can't be ajusted on-the-fly, it just can be done in compilation / synthesis time.

Those modules is simple designed, no complexity such as parity bit or two stop bits is implemented.

UART TX module

UART TX Module

Module inputs:

i_clk        : System clock
i_start      : Start pulse
[7:0] i_data : Data to be send

Module outputs:

o_done       : Done pulse output
o_busy       : Busy signal output
o_dout       : Data out (TX) output

Module Waveform:

UART TX Waveform

UART RX module

UART RX Module

Module inputs:

i_clk       : System clock
i_enable    : RX enable signal
i_din       : Data in (RX)

Module outputs:

[7:0] o_rxdata  : Data received
o_recvdata      : Data received pulse
o_busy          : Busy signal output

Module Waveform:

UART RX Waveform

Prerequisites

Any Verilog compiler tool and a logic waveform analyzer, for instance: GTK Wave.

A FPGA (optional).

Compile and test

  1. Compile the source code using Icarus Verilog:
iverilog -o uart_tb.out uart_tb.v
  1. Executing the compiled file (run the tests):
vvp uart_tb.out
  1. Opeing the waveform analyzer:
gtkwave uart_tb.vcd

Explaining the testbench

The testbench script perform a series of stimulus on UART RX/TX modules, and those can be analyzed to check if the module behaviour is working as expected.

The module was tested successfully on Altera Cyclone II and works fine using a such low resources from FPGA.

Versioning

17/10/2018 - Initial work (V1.0)

Authors

  • Matheus Alencar Nascimento - Initial work

License

This project is licensed under the MIT License - see the [LICENSE] file for details

Acknowledgments

fpga-uart-tx-rx's People

Contributors

matt-alencar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.