I've got an SPI master/slave test circuit set up between two Atmel ATmega microcontrollers, with the master on an STK500 development board and th slave on a breadboard.
I noticed that sometimes I would get noisy communications and other time I would not get any noise at all, but it seems to depend on how the wire are positioned. The cables I'm using to connect master and slave are som "random" ones I've ripped out of an old computer (used to link th motherboard to the LEDs and switches on the front of the case). There's pair of wires for 5V and 0V, and four SPI data wires. They're only abou
30cm long.One time when I held all the cables tightly I noticed that the nois stopped, and when I moved them apart, the noise returned. I thought this may have been something to do with external noise, so wrapped some aluminium foil around the six wires (all together) and th communications be came error free.
Doing this has solved my problem, but I was still curious, so I remove the foil and tied all the wires tightly together with string. The error disappeared again. The errors only seem to appear when the data cables are separated from th power cables. Shielding the data and power cables separately (rather tha together in one sheet of foil) results in the errors returning.
Does anyone know the reason for this? Is it something to do with the coupling between the ground and dat lines? Thanks for any suggestions.