Simple 8-bit UART realization on Verilog HDL.
Able to operate 8 bits of serial data, one start bit, one stop bit.
CLOCK_RATE
- board internal clock rateBAUD_RATE
- target baud rate
clk
- [input] board internal clock
rx
- [input] receiver inputrxEn
- [input] enable/disable receiverout[7..0]
- [output] received datarxDone
- [output] end of transaction (1 posedge clk)rxBusy
- [output] transaction is in progressrxErr
- [output] transaction error: invalid start/stop bit (1 posedge clk)
txEn
- [input] enable/disable transmittertxStart
- [input] start of transaction (1 posedge clk)in[7..0]
- [input] data to transmit (stored inside while transaction is in progress)tx
- [output] transmitter outputtxDone
- [output] end of transaction (1 posedge clk)txBusy
- [output] transaction is in progress
Uart functional modeling on:
CLOCK_RATE=32
BAUD_RATE=1
T(clk) = 0.5us
T(rxEn) = 800us
T(rx) = 128us
T(txEn) = 700us
T(txStart) = 200us
T(in) = 30us
(counter inc by 1)
Receiver functional modeling on:
T(clk) = 1us
en=1
T(rx) = 144us
Transmitter functional modeling on:
T(clk) = 1us
en=1
T(start) = 200us
T(in) = 30us
(counter inc by 1)
Baud rate generator functional modeling on:
CLOCK_RATE=32
BAUD_RATE=1
T(clk) = 0.5us
- testbench
- parameter to control data width