Cap needed on SPI connection. But I don't know why ?
![Bean](https://forums.parallax.com/uploads/userpics/855/n505WZVEIPHT1.jpg)
I've working with a maxim chip that has the typical 4 wire SPI interface (CS, SIn, SOut, SClk).
I couldn't talk to the chip, so I connected the Parallax OScope to the SClk and SOut pins.
When I ran it it worked. I assumed I has a loose connection or something. I could take the probe off of the SOut pin and it still worked, but when I took it off of the SClk pin I would get garbage.
So I put a 15pF cap on the SClk pin to ground and that seems to fix it. But I've never had to do this before. So I'm wondering why does the 15pF cap make it work ? Of course I can't see what the signal looks like without the probe or cap on.
There IS a 27MHz output relatively close (a few tracks away), but the tracks in between have DC on them ?
Any explainations ?
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
Post Edited (Bean (Hitt Consulting)) : 11/24/2007 2:53:23 AM GMT
I couldn't talk to the chip, so I connected the Parallax OScope to the SClk and SOut pins.
When I ran it it worked. I assumed I has a loose connection or something. I could take the probe off of the SOut pin and it still worked, but when I took it off of the SClk pin I would get garbage.
So I put a 15pF cap on the SClk pin to ground and that seems to fix it. But I've never had to do this before. So I'm wondering why does the 15pF cap make it work ? Of course I can't see what the signal looks like without the probe or cap on.
There IS a 27MHz output relatively close (a few tracks away), but the tracks in between have DC on them ?
Any explainations ?
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
Post Edited (Bean (Hitt Consulting)) : 11/24/2007 2:53:23 AM GMT
Comments
You didn't mention what chip is driving the SPI peripheral or how it's wired up. (e.g. are SIn and SOut connected together? Through a resistor?) But, without having that info, I'm guessing your clock is not being strobed at the right time relative to the data line. Perhaps it's inverted? Some example code would be a great help, too.
-Phil
I'm driving it with an SX28.
SIn and SOut are on different pins, no resistors, both running at 5V.
It chip works fine with the 15pF cap on the SClk line, so the code does work. It's just SHIFTOUT and SHIFTIN, nothing special.
Without the cap, I can see that the data is cut-short (by probing the CS and SOut). It seems like the clock is getting extra pulses without the 15pF cap ??? My guess is that it is just noise...
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
-Phil
I had a similar issue with the propeller resetting due to low-pulses on the RES line. A 10nf cap sorted it out!
I'd guess then if you really slow the code down it'd go away?
james