SPI line - noise voodoo :(

Thread Starter

russian

Joined Sep 1, 2012
56
I have a mcp3208 ADC chip in a breadboard wired to an stm32 board. The board is powered via the USB, SPI frequency is 160Hz. The board also has a USART serial for me to look at the output.

Things work great only if I have a USB logical analyzer wired just to the MISO line. With the analyzer plugged into another USB port, I have a 100% success rate in my SPI communications (expected 3-byte responses are like something like FFEA9D). Actually, just to troubleshot I've already sliced the USB cable between the analyzer and the desktop and left just the ground wire. This way the analyzer is just a passive black box between the MISO pin and my desktop usb GND. Grounding the black box to the board does NOT do the trick, it has to be USB ground.

As soon as I disconnect the analyzer, I start seeing a 30-50-80% error rate: the initial bits of the response are wrong in half of the SPI responses (the wrong responses are something like A9D - i.e. all the upper bits are lost)

I've tried grounding the MISO line with 2pf. 10pf. 100pf etc capacitors to no avail. I've tried "parallel termination" with a 150ohm 100pf in series. I've tried same with grounding to USB desktop ground.

The only value my multimeter is showing it I test between the ends on the "black box" is 1.3 is diode continuity mode.

Please advice or I will seek mental health help.

 

simo_x

Joined Dec 23, 2010
200
Are you sure you have configured the GPIO output driver (or generally configured) correctly?

Don't you have an oscilloscope right? :(
 
Top