Shop OBEX P1 Docs P2 Docs Learn Events
SPI communication; Combining Din and Dout — Parallax Forums

SPI communication; Combining Din and Dout

parskoparsko Posts: 501
edited 2006-11-20 17:15 in General Discussion
All,

When doing SPI communications, can the Din and Dout Lines be combined together?

For instance:
MCP3002 has two separate pins for data; Din, and Dout. Can I use one (Propeller) output pin tied to both the Din and Dout without consequences?

Another for instance:
24LC515 has ONE pin for both Din and Dout. Can I use two (Propeller) pins together and tie them both to the same pin?

Thanks,

-Parsko

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2006-11-20 16:06
    parsko,

    It depends on the device itself... the "safe" way to do it is to connect something like a 1K resistor across the Din and Dout pins of your device, then use the Din of
    your device to connect to a Stamp, SX,·Propeller, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • parskoparsko Posts: 501
    edited 2006-11-20 16:39
    Clever! I will try just that when my code is ready for it and post my results...

    Thanks,

    -Parsko
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-11-20 16:50
    Beau -

    As you know I'm not an adept hardware guy, so take this question as such. In the absolute worst of cases (not with a Stamp but with posibly some other platform) couldn't a simple, signal diode be placed between Din and Dout which would avoid any possible "back-feed" problems whatever the case?

    TIA

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • NewzedNewzed Posts: 2,503
    edited 2006-11-20 17:03
    Don't think so, Bruce.· Suppose you had the cathode connected to Din.· A Dout signal would go to Dout but not Din.· However, a Din signal would go to both Din and Dout.· The level at Dout would be minus the drop accross the diode but it would still be substantial.· The best way is a 1k resistor across Din and Dout.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-20 17:15
    Hello,
    ·
    ·· One other thing to consider here…Most SPI devices will work this way.· Our documentation on several such items supports this.· There are a few SPI devices that shift data out at the same time as the data is being shifted in.· In these cases you wouldn’t be able to easily combine the pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.