UART transmitter

Send a byte down a wire, one start bit, eight data bits, one stop bit.

When to use it

UART is the simplest way to get bytes off an FPGA to a PC or another chip: no clock line, just a single wire per direction at an agreed baud rate. This transmitter sends the standard 8N1 frame: an idle-high line drops for one start bit, then 8 data bits LSB-first, then returns high for the stop bit.

How it works

Load the byte into a shift register framed by a 0 start bit and a 1 stop bit, then shift it out one bit every CLKS_PER_BIT clocks (that constant sets the baud rate for your clock). busy marks the frame; assert start for one clock to begin.

Gotchas

Try it

Runs on our simulator, edit the code and press Run to see the waveform.

Open & fork in the playground → Ship the verified version: lfpga add lfpga_uart_tx

The runnable example above is a teaching version. The libfpga library ships a hardened, parameterised, CI-tested module (lfpga_uart_tx) for production use.

Next recipe: Gray-code converter