IS YOUR SPI GITCHY ?????
Have you even face a scenario where your spi run sometimes very well and sometimes it just fails ?
Recently i face such issue that when logic analyzer was connected on spi bus it communicated well with slave devices and as soon as logic analyzer was removed our code just failed to communicate with slave device
First we thought that maybe it has something to do with delays in our code and we tried changing spi baud rate too but it was all in vain
what could be the issue and what could be the solution?
since logic analyzer tapped the bus in parallel we realized that it added impedance on spi bus making it more stable .Luckily enough on our pcb we had option to add termination resistor in series to spi bus line and once we added 1k resistor it became stable
Question is does spi lines needed controlled impedance we all thought no and that is the truth and but many factors effect a trace impedance and it changes especially when layers are switched on multi layers board
so it is best practice to add option of adding termination resistor on bus lines so when the bus becomes glitchy we can know that we can change the termination resistor values
This article just tackles the issue in a quick possible solution on spot there maybe many other factors to be considered
Engineer | Signal & Power Integrity
2 年We tend to think of SPI as a “low speed” interface but more than just the clock frequency we need to consider the signal edge-rates (slew rate). Those can have very high frequency harmonics. This can be an issue even with a straight-forward reset line. Something else to note - a logic analyzer’s job is to decode the signal into 1s and 0s. You won’t get the ISI/XTALK details from that unless you check with an oscilloscope. Part of debugging a glitch should also include checking the timing and voltage levels vs. setup/hold times and Vil/h requirements.
PCB Designer With Skills to Debug SI, PI and EMC Issues | Always Available to Discuss Electronics
2 年Funnily it happens sometimes. One reason could be due to reflections. Signals reflect when they see change in impedance. An ideal situation will be to have same impedance of transmitter, trace and receiver, then signal will not reflect. If any of thing in the path has a different impedance, signal reflects from there back towards transmitter. If the path has multiple impedance changes, signal keeps on reflecting and bouncing back and forth. When you add series resistor in the path, it damped the oscillations and signal integrity improved. This solution is at the cost of higher spi baud rate.
IoT & Embedded Engineer | Embedded system | Debugging | Embedded C | Firmware developing & debugging
2 年Muhammad Usama Aslam
IoT & Embedded Engineer | Embedded system | Debugging | Embedded C | Firmware developing & debugging
2 年logic analyzers are really amazing