0
\$\begingroup\$

I've connected a Rasperry Pi to a MSP430 uC using a 3 wire 8bit SPI interface. The SPI communication seems to work (I've checked on both ends and the data is correct).

On the PI I communicate using a user-land spidev client (no persistent state machine). On the MSP430 the SPI state machine is only initialized at startup.

If I touch the SPI clock wire with one of the multi-meter's connectors (+ or -, doesn't make a difference) the SPI connection goes out-of-sync (I see garbage data on both ends) until I reset the MSP.

Is this normal behavior or am I facing a connectivity/grounding problem?

\$\endgroup\$
  • 2
    \$\begingroup\$ This appears to be either a ground problem, or loose contact on the lines - more likely the former. With a robust ground connection, touching just one pin should not create sufficient noise to throw the SPI sync off. \$\endgroup\$ – Anindo Ghosh Jan 3 '13 at 15:55
  • \$\begingroup\$ make sure your connections are as short as possible and that you have good ground connection. \$\endgroup\$ – Gustavo Litovsky Jan 3 '13 at 16:52
  • \$\begingroup\$ I'm using a breadboard. The wires are 20 cm or so (10 cm from PI to breadboard and 10 cm from breadboard to uC). \$\endgroup\$ – diciu Jan 3 '13 at 16:54
  • \$\begingroup\$ While there could be an electrical problem or bad timing that barely works in the normal case, I'm not as convinced that this would be abnormal behavior if the clock rate is high. However, I am concerned about the lack of recovery from such a fault - I'd want a proper peripheral to be fine for subsequent access once it's SPI slave select has been released and properly re-asserted, and a sequence of commands known to bring it to a good state is issued. If a communication error is requiring a hardware reset, that seems wrong. Though you could have a spike or supply fault crashing the chip. \$\endgroup\$ – Chris Stratton Jan 3 '13 at 20:04
  • 1
    \$\begingroup\$ @GustavoLitovsky - I think it is probably better to examine the interface carefully, verify the timing, etc and try to prove that it is a proper implementation. Statistics may not be relevant unless the test conditions include the fairly narrow range where both working and not-working cases can occur during a trial. Though static loading with assorted high-value resistors might be interesting. \$\endgroup\$ – Chris Stratton Jan 3 '13 at 20:16
1
\$\begingroup\$

Do not underestimate the capacitance of a probe and it's ability to shift the behavior of a high speed circuit. It's hard to make a determination without some scope pictures, but I have seen broken circuits work and good ones fail due to the use of a probe with a relatively high scope capacitance which changes the system behavior.

| improve this answer | |
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.