A UART simulator: serial frames you can see
Mokxi is a free online UART simulator that runs in your browser, with nothing to install and no account needed. An Arduino Mega 2560 sends a “ping” line out of three of its serial ports once a second, each port wired back to itself at its own baud rate, and a logic analyzer on the first port’s TX pin writes every byte over its frame.
- 455parts on the bench
- 43boards running now
- 1.00xreal time, on every board
What you can do here
In the circuit above, or in the editor it opens.
- Watch 8N1 frames on the logic analyzer, decoded at any baud rate
- Change one port’s baud rate and see the bytes come back as garbage
- Wire two boards together over serial, each running its own sketch
- Type into the serial monitor and read it back with Serial.read()
- Talk to an HC-05 Bluetooth module or a GPS over SoftwareSerial
- Edit the Arduino code and press Run again
What the running circuit shows
Each port hears itself.
Serial1 opens at 9600 baud, Serial2 at 19200 and Serial3 at 38400, and each one’s TX pin is jumpered to its own RX, so whatever a port sends it receives a moment later. In the engine the first “Serial1 heard: ping 1” reaches the serial monitor about a second after the board starts, followed by Serial2 and Serial3, and the count goes up by one every second.
The analyzer on pin 18 is set to UART at 9600, and it writes p, i, n, g, a space, the number, \r and \n over the trace, one label per frame. A frame is a start bit, eight data bits sent least significant first and a stop bit, ten bit times in all, so at 9600 baud each byte takes about 1.04 ms. Take the jumper off Serial2 and its lines stop arriving while the other two carry on.
How serial is modeled
Real frames on real wires.
The Mega’s USARTs are modeled from the chip’s registers, so the baud rate comes from the same divisor the real chip uses and the frames on the wires are real start, data and stop bits. The analyzer decodes those edges, not a copy of the bytes, so the wrong baud rate gives frame errors on the trace the way it does on a real one. Serial, the fourth port, goes to the serial monitor.
What it leaves out: the voltage on the line is ideal, with no ringing, and there is no USB adapter between the board and the monitor. On an Uno the monitor is wired to the USART directly, so pins 0 and 1 stay ordinary pins; that is why this page uses the Mega, whose extra ports come out on header pins.
Questions
Is it free?
Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.
Do I need an account?
No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.
Can I decode UART on the logic analyzer?
Yes. Set the analyzer’s decoder to UART, give it the baud rate and parity, and it labels each byte over its frame. It decodes I2C and SPI as well.
Can two boards talk over serial?
Yes. Put two boards in one project, cross TX and RX and join their grounds; each runs its own sketch and the wires between them carry real frames.
What happens at the wrong baud rate?
The receiver samples the bits at the wrong times, so the bytes come back as garbage and the analyzer marks bad frames, as on a real board.
More simulators
Each one opens on a circuit that is already running.
Send a byte
Open the circuit, press Run and read the frames. Nothing to install, and no account needed.