Codiode

SPI Mode 1 Timing

MediumLogic CircuitBuild

Many high-speed sensors require SPI communication where data is shifted on the leading clock edge and sampled on the trailing edge. This specific phase and polarity configuration ensures setup and hold times are met across long bus traces.

Implement the core datapath for an SPI Mode 1 interface. The system uses a clock signal sck which idles low. The mosi output must update with the value of tx_bit on the rising edge of sck. The rx_bit output must capture the value of miso on the falling edge of sck. An active-high rst signal asynchronously clears both outputs to 0.

Event mosi rx_bit
rst = 1 0 0
sck ↑ tx_bit Unchanged
sck ↓ Unchanged miso

Constraints

  • Use D flip-flops for state retention.
  • Do not use transparent latches.
  • The reset signal must clear the state asynchronously.

Topics

Sequential LogicFlip-FlopsSPI

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Part of Interface and Communication Circuits

Problem 58 of 79 in the Interface and Communication Circuits track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.