Shop OBEX P1 Docs P2 Docs Learn Events
I/O pins count increase — Parallax Forums

I/O pins count increase

hmlittle59hmlittle59 Posts: 404
edited 2009-02-02 18:27 in BASIC Stamp
Hello All,

I've used all 16 pins and need 2 more. Short of changing chips is there any other way to increase the pin count with additional components???


Any help please...I did a search of forum and could not find any thing



thanks to all

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!

hmlittle59

Comments

  • skylightskylight Posts: 1,915
    edited 2009-01-20 20:51
    Are the two extra pins going to be inputs, outputs or both?
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-01-20 21:19
    hmlittle59,

    Can you post a schematic? There may be ways to consolidate the pins.

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

    IC Layout Engineer
    Parallax, Inc.
  • hmlittle59hmlittle59 Posts: 404
    edited 2009-01-20 21:31
    1) input
    1) output

    DS1302 chip/4 push sw/1 Piezo/1 LCD/3 R-G-Y LEDs/3 scrs/3 MAG. sw... the LEDs (green on/red off) can not be consolidated because at times they need to be both off.



    thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!

    hmlittle59
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-20 22:24
    Okay, you have an SPI device in your system already. This makes it easy to expand I/O. My favorite form of expansion is shift registers, especially when there’s already an SPI device in the system. You can share the Clock and Data lines for each SPI device and each requires its own /CS, /RES or latch control as the case may be. So if you add a 74HC595 you could turn on/off your SCRs and LEDs using that and free up the I/O lines they occupied. One of these would in turn control the latch input on the HC595. If you need more information just reply here. In the mean time have a look at the project below which uses six SPI devices using the same Clock and Data lines. Take care.

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • hmlittle59hmlittle59 Posts: 404
    edited 2009-01-20 23:31
    Thanks for the reply...I'll look at the project you have posted and get back with ya'll for any additional help.


    thanks again

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!

    hmlittle59
  • hmlittle59hmlittle59 Posts: 404
    edited 2009-01-21 01:58
    I have downloaded the code and schematic and will study them to under stand how to design it in, right now the schematic is not clear to me. I will start on the code later.



    thanks again

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!

    hmlittle59
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-21 06:06
    No problem...let me know how you make out. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • hmlittle59hmlittle59 Posts: 404
    edited 2009-01-25 00:21
    Hello Chris S,

    I'm still trying to understand all that is happening with your program and schematic. I've down loaded a .PDF file for the chip to better understand how it works and the program is executing . My current thinking is to use my LAST free Data line to control one more (SSR) not (SCR) like I stated before(my bad) and (2)HIGH/LOW of a switch. Is that possible with only one last I/O line???


    thanks for any help

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!

    hmlittle59
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-26 17:12
    Three devices with one I/O pin? Not without a device that can expand the I/O. I tried to simplify my design as much as possible. The key really is in using multiple SPI devices and sharing those Clock/Data lines. Using that scheme you can even get discrete I/O using the shift registers with only the one additional pin. Picture this…adding 32 inputs with only one I/O pin. The catch? You must have another SPI device to share the other lines with. I was pretty sure you had one, so you could add the shift register using that last I/O pin and gain 8 or 16 outputs no problem. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • hmlittle59hmlittle59 Posts: 404
    edited 2009-01-27 17:22
    Hello Chris S,

    First I understand the theory/concept of whats suppose to happen, but for me to jump in now and start redoing my code and electronics, I'm FAR from that point so if you could bare with me PLEASE. Note:With the 4th spin of my board I switched to DIPtracePCB software and used all SMT components even the BS2. I'm now using the BS2e and I'm in Bank 3 with my code that monitors the SW, activates the SSRs and Piezo. To avoid any major coding problems my thinking is to move the LEDs(2) and Piezo(1) to the SPI chip because this should be just on/off.

    So now I should have:

    1) LEDs(2)+Piezo(1) = 3
    2) FREE Pin(1) = 1
    3) DS1302 (2) share = 2

    that should be 6 lines to get the SPI working...My thinking is to activate the Piezo(chirp), turn ON/OFF the LEDs as needed and program the DS1302 without going thru the SPI chip, that way I will not have to bother the routines for the Switches and SSR(they have a lot of activity going on within those sub-Routines).

    I Googled the chip and read some of the links about Master/Slave hook ups trying to understand how it works..Within my program I Set the DS1302 and read/write to the DS1302 RAM for storage so I know how to Set/Clear but I don't see any of this going on within your BINARY program(set/clear). Maybe I'm just way off base in my thinking of how this chip works and thats why I can't grasp it. I see were you Gosub Out_595. Point me some were to Read more on the Basics...thanks

    thanks for your time

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!

    hmlittle59
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-02-02 17:17
    The Stamp Works manual goes into some more details on how things work. You can download a PDF of this from our website. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • mechanomechano Posts: 8
    edited 2009-02-02 18:27
    hi

    try this ..... i'm not sure it will work with you

    Nut & Volt Magazine - Column #79 (Expand Your Stamp’s I/O With I2C)

    thanks for (Mike Green) who told me before about it

    regards
Sign In or Register to comment.