SPI line - noise voodoo :(

Discussion in 'The Projects Forum' started by russian, Aug 17, 2013.

  1. russian

    Thread Starter Member

    Sep 1, 2012
    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.

  2. simo_x


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

    Don't you have an oscilloscope right? :(
  3. russian

    Thread Starter Member

    Sep 1, 2012
    I am sure that when I spin a pot I read expected values from the ADC.

    No oscilloscope :(
  4. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    Pullup resistor?
    russian likes this.
  5. russian

    Thread Starter Member

    Sep 1, 2012
    And the winner today is THE_RB with a 10k pull-up resistor.

    But why???