Communication protocol timing simulator
A completed discrete-event timing study for UART, SPI, and I2C with valid transfers, timestamped waveforms, decoding, exact timing, and controlled fault injection.

Project definition
Problem statement
Serial protocols depend on clock rates, sampling positions, edge order, pull-up behaviour, addressing, and device configuration. Many failures appear only as a waveform or intermittent decoded error.
The engineering problem is to model protocol events accurately enough to explain timing behaviour and reproduce common configuration and electrical-level faults without requiring physical hardware.
Project objectives
- Generate a four-byte UART transfer at 115,200 baud and decode it.
- Generate a two-byte full-duplex SPI mode-zero transfer at 1 MHz.
- Generate an I2C fast-mode address and two-byte write at 400 kHz.
- Inject UART framing and baud-rate faults, an SPI phase fault, and an I2C acknowledgement fault.
- Retain every event, timing value, decode, figure, and acceptance outcome in open formats.
Project structure
Project components
UART model
Generates frames, samples data bits, decodes bytes, and reports stop-bit errors.
SPI model
Generates CS, SCLK, MOSI, and MISO events for mode-zero full-duplex transfers.
I2C model
Generates start, address, data, acknowledgement, clock, and stop events.
Fault laboratory
Applies prepared framing, baud, clock-phase, and missing-acknowledgement faults.
Evidence runner
Writes 328 event rows, summary JSON, and fourteen PNG and SVG figure pairs.
Methodology
Project workflow
- 01Configure
Read the committed protocol rates, bytes, address, mode, and fault locations.
- 02Generate
Create timestamped binary signal transitions for every valid and faulty scenario.
- 03Decode
Recover UART and SPI bytes and evaluate I2C acknowledgements.
- 04Measure
Calculate exact bit and clock periods and compare fault outcomes.
- 05Retain
Write the event CSV, summary JSON, waveforms, comparisons, and test evidence.
Demonstration scenario
Run the complete study, inspect the valid UART, SPI, and I2C waveforms, then compare each fault plot and decoded value with its valid case. The open event CSV provides the timestamp and level behind every displayed edge.
Engineering
Tools and method
- Tools
- The project uses Python, matplotlib, NumPy, pandas, Jupyter, Matplotlib for subject analysis, simulation, and results.
- Protocol core
- Pure Python discrete-event functions for UART, SPI, and I2C.
- Evidence
- CSV and JSON outputs preserve timestamps, signals, levels, and decoded outcomes.
- Figures
- matplotlib produces fourteen paired raster and vector plots.
- Verification
- Seven automated test groups cover valid transfers, faults, timing, outputs, and repository structure.
- Reproducibility
- Python 3.13.7 and direct package versions are pinned in Docker.
Testing
Evaluation
Evaluation measures
- UART recovers all four prepared bytes without a valid-scenario framing error
- SPI mode zero recovers both prepared MOSI bytes
- I2C records all three valid acknowledgements
- The UART framing fault produces one stop-bit error
- The 12 percent UART baud mismatch and SPI CPHA mismatch change decoded bytes
- The missing third I2C acknowledgement is detected
- All fourteen PNG and SVG result pairs regenerate
Project boundaries
- The simulator models ideal binary events, not analogue signal integrity.
- It does not model voltage, current, rise time, ringing, loading, cable effects, or noise.
- The first version covers the prepared UART, SPI mode-zero, and I2C write scenarios.
- Physical compliance requires measurement with an oscilloscope or logic analyser.
Included
- 01UART, SPI, and I2C event models and prepared transfers
- 02Valid and faulty waveform comparisons
- 03Open event CSV and summary JSON
- 04Fourteen result figures in PNG and SVG formats
- 05Complete project files, models, calculations, and analysis material in a private GitHub repository
- 0680-page project report in PDF and editable Word formats
- 079-page setup and usage guide
Project record
No information is collected on this page.
- Permanent project ID
- GP-EC-08BN3KY
- Catalogued
- 21 Aug 2026
- Completed
- 23 Aug 2026
- Verified
- 23 Aug 2026
- Demonstration
- Included in repository
Handover
After purchase
- 01Payment is confirmed
The project is marked unavailable and cannot be purchased again.
- 02Repository access is granted
The buyer's submitted GitHub account receives access to the private repository.
- 03The purchase record is delivered
The certification sheet is prepared from the reviewed buyer details and sent privately by email.