This design implements a UART transmitter using registers made from D-flip flops and multiplexers.
Background
UART stands for Universal Asynchronous Receiver Transmitter and is a common serial protocol useful for getting data to/from a device, for example between an Arduino and a computer or a sensor.
UART works by sending data frames serially (i.e. one bit after another) at a pre-specified data rate, also known as a baud rate. While several different data frames are possible, commonly the 8N1 protocol is used to send 8 bits with No parity bit, and 1 stop bit. We can observe this protocol in the image below. A few things to note:
The duration of a bit is determined by the bit rate of the UART transmitter and receiver, and the data rate must be set to the same value in both the transmitter and receiver for successful communication.
This circuit, inspired by @maehw, implements a shift register with 17 bits: four idle bits, one start bit, eight data bits, one stop bit, and three more idle bits.
The circuit supports transmitting a user-selected ASCII character from 0x40 (@) to 0x5F (_), including capital letters from the Latin alphabet.
How to use
Example Sending ‘A’
Serial.begin(<baud rate>);
in the *.ino file to 300"attrs": { "frequency": "300" }
in the diagram.json to 300 as wellCongratulations! You should now see the letter being output in the Wokwi Arduino Serial monitor at the bottom of the simulation.
Note that garbage characters may be printed upon initialization.
SW | Function |
---|---|
1 | N/A |
2 | Bit 0 |
3 | Bit 1 |
4 | Bit 2 |
5 | Bit 3 |
6 | Bit 4 |
7 | Load/TX |
8 | Output Enable |
This circuit implements five shift registers to transmit ‘Tiny\n’.
Each column of flip flops stores a single ASCII character. To modify a character, change bits 6-0 by modifying whether the respective multiplex is set to VCC or GND.
To add characters, copy and paste a column. Connect the output of the new column (Q port of the upper-most D-flip flop) to the input of the stage to the left (bottom-left most multiplexer port). Remember to connect the multiplexer select signal and the clock to the new column as well.
Lastly, delete the output of the first column (Q port of the upper-most D-flip flop) and create a new connection to the to the input of the new stage you’ve added (bottom-left most multiplexer port).
How to use
To begin transmission:
Serial.begin(<baud rate>);
in the *.ino file to 300"attrs": { "frequency": "300" }
in the diagram.json to 300 as wellCongratulations! You should now see your customized letters being output in the Wokwi Arduino Serial monitor at the bottom of the simulation.
Note that garbage characters may be printed upon initialization.
SW | Function |
---|---|
1 | N/A |
2 | N/A |
3 | N/A |
4 | N/A |
5 | N/A |
6 | N/A |
7 | Load/TX |
8 | Output Enable |