IS YOUR SPI GITCHY ?????

IS YOUR SPI GITCHY ?????

#embeddedsystems #spi #embeddedengineer

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

Ish Franco

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.

Abdul Hanan

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.

回复
Talha Ahmed

IoT & Embedded Engineer | Embedded system | Debugging | Embedded C | Firmware developing & debugging

2 年
Talha Ahmed

IoT & Embedded Engineer | Embedded system | Debugging | Embedded C | Firmware developing & debugging

2 年

logic analyzers are really amazing

要查看或添加评论,请登录

Isfandyar Qureshi的更多文章

  • WHY IT SUCKS TO BE EMBEDDED ENGINEER!!!!

    WHY IT SUCKS TO BE EMBEDDED ENGINEER!!!!

    This article is a personal experience and observation over my 6-7 years as an electronics/embedded engineer. Your…

    69 条评论
  • Sending Struct on SPI?

    Sending Struct on SPI?

    Another short article for embedded developers like me who are learning We all use structures in our C / C++ programing…

    3 条评论
  • Common Issue with SPI

    Common Issue with SPI

    Spi is very common protocol and is used very often it has its perk of multiple sensors on common bus etc Hardware used…

    1 条评论
  • MOCKING THE MYSTERY IN UNIT TESTING

    MOCKING THE MYSTERY IN UNIT TESTING

    Greeting everyone are you a software engineer making apps or are you an embedded iot developer. This article is for…

  • RTOS DEBUGGING IN REAL TIME USING OZONE AND SYSTEM VIEWER

    RTOS DEBUGGING IN REAL TIME USING OZONE AND SYSTEM VIEWER

    Finally got my stlink-V2 on nucleo board to debug rtos providing me to see at what instance which task is running at…

社区洞察

其他会员也浏览了