Shop OBEX P1 Docs P2 Docs Learn Events
Pin Sharing Between Stamp Peripherals — Parallax Forums

Pin Sharing Between Stamp Peripherals

dredre Posts: 106
edited 2009-08-20 16:45 in BASIC Stamp





·For a Controller/Datalogger project I am working on I have allotted the following Stamp I/O assignments:

·TLC2543 ADC -··cs, ·Sdo *, Sdi *, clk *

·DS1302 RTC - Data_I/O, Clock, Chip Select

·#27937 Memory Stick Datalogger - RTS, RXD, TXD, CTS#

·For a total allocation of 11 pins. I need to have 7 or 8 pins for control. And the Stamps I have are all the 16 I/O pin version. Hence· the··problem.· Per Tracy's write-up these [noparse][[/noparse]*] pins "can be shared with other serial peripherals". But with which other peripheral pin assignments ?

·If necessary I could use the following IC for control, but I would like to be able to use the "OutH" command for the control pins; and, if possible, I would like to have a few extra pins - as this is a work-in-progress:

·74HC595 shift register -··clk,·Data_in,·Latch

·Any suggestions in regard to pin sharing would be appreciated.

·By-the-way, can I use aliases for shared pin callout?

·cheers, David



Comments

  • ZootZoot Posts: 2,227
    edited 2009-08-19 16:51
    pin x = TLC2543 Sdo, DS1302 Data_I/O, Memory Stick Datalogger TXD (note: use 1k resistor on bidirectional i/o -- but I thought the 1302 had separate DI/DO/CLK pins? Can't remember...)
    pin y = TLC2543 Sdi, Memory Stick Datalogger RXD, 74HC595 data_in
    pin z = TLC2543 clk, DS302 Clock, 74HC595 clk

    pin a = TLC2543 cs
    pin b = DS1302 Chip Select
    pin c = 75HC595 Latch
    pin d = Memory Stick Datalogger RTS
    pin e = Memory Stick Datalogger CTS

    Basically any DO/TX lines can be shared, any DI/RX lines can be shared, bi-directional DI/DO can be shared if you have a resistor on the output pin of the peripheral to prevent short when the line is being used as a DI elsewhere. Clocks can always be shared. Chip select (CS, enables, latches, etc) usually need their own pin (although I often use a "master" 74HC595 to control multiple cs/enable/latch lines on peripherals, but the cascading and programming gets a bit thorny).

    I'm not familiar enough with the datalogger to be able to say if RTS and CTS can or can not be shared with other lines; if that is possible pin count could be cut by 1 or 2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-19 16:59
    The only pins you could share:

    TLC2543 clk with DS1302 Clock

    TLC2543 Sdi with DS1302 Data_I/O

    You could also use a BS2p40 which has another 16 I/O pins (two banks of 16).
  • dredre Posts: 106
    edited 2009-08-20 16:19
    Zoot, Mike,
    Many thanks for your replies. I am now confused on a much higher plain smile.gif. I am going
    to first try the design w/o using the -595. I also appreciate the alert on using the 10k
    protection resistors.
    The reason for not going to the 40 pin Stamp is that I have several regular Stamps
    available and I knew that my pin allocation problem could be solved, if necessary, by
    incorporating the -595.

    Again, thanks, David
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-20 16:27
    The main advantage in using the BS2p40 is that it's much faster using the extra pins because you only need to do a MAINIO or AUXIO to switch between them and you can use all of the existing Stamp statements directly on the bank of I/O pins. With 74HC595s or 74HC165s, you have to shift the data out/in to the chips and that's relatively slow. It works fine for lighting LEDs or sampling switches where a couple of hundred samples per second are ok, but not for anything requiring tighter timing.
  • tronsnavytronsnavy Posts: 70
    edited 2009-08-20 16:45
    Dre,

    Not sure if this would work for your situation but what about decoders/demultiplexers such as the 74LS138. With this IC, you can take 3 i/o pins and make 8 output pins. Each binary value (from 000 to 111) selects one of eight outputs. You said that you need 7 or 8 pins for control. This might work. Check out the data sheet for these IC's. I use them whenever I don't have enough output pins. Good luck.

    Bob
Sign In or Register to comment.