UART, SPI and I2C interface problems
Every chip talks to something. These problems build the pieces of the common serial interfaces: the UART frame with its start bit, parity and oversampling, the SPI clock polarity and phase, and the I2C start, stop, acknowledge and arbitration.
118 problems8 free to solve15 easy, 61 medium, 42 hard
Around them sit the small circuits every interface needs: edge detectors, pulse stretchers, debouncers, period and duty cycle measurement, and the valid ready handshake.
What these problems cover
- UART framing, parity, baud rate and oversampling receivers
- SPI masters with configurable polarity and phase
- I2C start and stop detection, read and write bits, clock stretching and arbitration
- Valid ready handshakes and pipeline stages
- Edge detectors, debouncers and pulse stretchers
Free to start
Solve these with a free account. Every other statement on this page is free to read.
Problems by track
Interfaces and Protocols19
- Synchronous Rising Edge Detector
- Continuous Counter Debounce
- Basic Pulse Width Modulator
- Glitch Free PWM with Shadow Register
- Basic Fibonacci LFSR
- Serial CRC-8 Generator
- Valid Ready Pipeline Stage
- The Skid Buffer
- Baud Rate Pulse Generator
- UART Transmitter FSM
- UART Receiver Oversampling Counter
- UART Receiver Data Shifter
Interface and Communication Circuits79
- Basic Rising Edge Detector
- Basic Falling Edge Detector
- Dual Edge Detector
- Delayed Edge Detector
- Maskable Edge Detector
- Shift Register Debouncer
- Symmetric Shift Register Debouncer
- Counter Based Debouncer
- Early Reset Debouncer
- Digital Hysteresis Filter
- Glitch Rejector
- Pulse Stretcher
Shift Registers12
- SIPO: MSB-First vs. LSB-First
- 8-Bit PISO: MSB-First Serial Output
- PISO: Back-to-Back Loading Without Gaps
- Bidirectional SR: PISO Application (Choose Bit Order)
- Bidirectional SR: Asymmetric Shift Speed Application
- Serial Link with Start and Stop Bits
- Start Bit Detection Waveform
- UART-Style 10-Bit Frame: Full Transmit and Receive
- Serial Link: Bit Rate Calculation and Clock Frequency
- Serial Transmitter with Output Enable for Bus Sharing
- PISO: Parallel-to-Serial Conversion for SPI Transmission
- Serial Link: Framing Error Detection
Finite State Machines1
Clocking and Synchronization2
FSM Coding2
SystemVerilog RTL1
More problems2
How your answer is checked
Circuit problems run on the circuit simulator against the problem's test vectors, clocked cycle by cycle when they are sequential. Verilog problems are compiled with Icarus Verilog and run against a testbench, with the waveform and the Yosys schematic beside the result. Analysis questions are checked against their answer key.
Questions
- Do I write a whole UART at once?
- No. The problems split each interface into parts you can test alone, such as start bit detection or the parity generator, and later ones put them together into a full transmit and receive.
- Are these useful for FPGA projects?
- Yes. A UART or SPI block written and tested here is the same RTL you would put on a board.