Shop OBEX P1 Docs P2 Docs Learn Events
Cap needed on SPI connection. But I don't know why ? — Parallax Forums

Cap needed on SPI connection. But I don't know why ?

BeanBean Posts: 8,129
edited 2007-12-11 15:56 in General Discussion
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

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-24 02:49
    Bean,

    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
  • BeanBean Posts: 8,129
    edited 2007-11-24 02:57
    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-24 03:03
    How long are your traces/proto wires? Do you have a separate bypass cap on the Maxim chip? Do the Maxim chip's power and ground leads connect directly to the regulator, or are they routed via the SX's power and ground pins? If you replace the cap with a 1K resistor at the Maxim chip's clock pin does it still work okay?

    -Phil
  • JavalinJavalin Posts: 892
    edited 2007-12-11 15:56
    I'd go with some high frequency noise. I guess you're seeing additional high/low pulses and thats screwing your data.

    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
Sign In or Register to comment.