Shop OBEX P1 Docs P2 Docs Learn Events
Shiftout Advice — Parallax Forums

Shiftout Advice

Tim-MTim-M Posts: 522
edited 2008-10-31 12:14 in General Discussion
A friend and I have built a walking light show Halloween costume with 32 pieces of electroluminescent wire on it. The lights are being on/off controlled using four sets of cascaded shift registers/ULN2803 driver chips with commands from a Basic Stamp II.

My question is regarding the best way to shiftout the 32 bits to the cascaded shift registers to update the outputs.

- Shiftout four bytes in sequence? 8 bits per byte?

- Shiftout two words in sequence? 16 bits per word?

- Is there a way to shiftout all 32 bits at one time?

Tim

Comments

  • Tim-MTim-M Posts: 522
    edited 2008-10-29 19:18
    Any advice from the cascaded shift register users out there?
  • stamptrolstamptrol Posts: 1,731
    edited 2008-10-29 19:46
    Tim,

    From the HELP file, the SHIFTOUT command is designed for a maximum of 16 bits. So you'd be looking at two banks of two 74hc595 shift registers to control 32 outputs. Probably two SHIFTOUTS's following each other in the program would do the trick.
    You should be able to share the clock and data lines for each set.

    Alternatively, to prove the point, you should be able to set up a program loop which would take your 32 bits of data (perhaps stored in the form of a DATA statement) and use the loop to simulate your own shiftout, clock and data lines. Then, you could have all 4 shift registers in cascade and clock everything out in your program loop.

    I'd go with using the two SHIFTOUTS.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Tim-MTim-M Posts: 522
    edited 2008-10-29 20:09
    Thanks for taking the time to help Tom.

    The wiring is configured with the four 74HC595/ULN2803 sets cascaded, so it may be a little late to separate them into two banks this close to Halloween. If I understand the process though, I can still do as you recommend and use two 16 bit SHIFTOUT's following each other to accomplish the 32 bit update, right?

    The clock and latch lines are shared and the BS2 has control of the output enable pin of each 595 to give us more 'razzle-dazzle' effect options.

    Thanks again for your advice,

    Tim
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-29 20:26
    Tim,

    There isn’t really a limit on the bits you can SHIFTOUT in one command, save memory constraints. For example, say you have three 74HC595 shift registers daisy chained. You can shift three bytes out before latching and all 24 bits will appear on the outputs at the same time. Have a look at the code snippet below from my Binary / Digital Clock. The time in binary is shifted out through three of these chips and then all three are latched at the same time. It could easily be 6 or 12, as long as you have the variables to send out. I hope this helps. Take care.

    P.S. – The sandbox probably isn’t the place to get quicker responses on BS2 questions. =)
    Out_595:
      SHIFTOUT DataIO, Clock, MSBFIRST, [noparse][[/noparse]secs, mins, hrs]
      PULSOUT HC595, 5                      ' Latch Outputs
      RETURN
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Tim-MTim-M Posts: 522
    edited 2008-10-29 20:45
    That helps clear things up alot for me Chris. I see the examples from the help files like Tom mentioned (that's where my options came from in the original post) but I didn't know if the more than 16 bits could be sent in one SHIFTOUT command, as you have shown. I guess it really doesn't make a difference if the job is done in one SHIFTOUT command or in several, but it helps me understand the process better and that's what I'm after in the end.

    It did help, Thanks.

    Tim
  • SeariderSearider Posts: 290
    edited 2008-10-30 22:57
    Tim,

    EL wire required a high frequency signal to cause it light, correct? did you also build the driver circuit? If so, would you mind sharing the scematic? I am interested in doing some work with EL wire.

    thx

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • Tim-MTim-M Posts: 522
    edited 2008-10-31 12:14
    Hi Searider,

    You are right that the EL-wire requires both higher voltage and frequency to light it up, each of them can vary quite a bit. If I understand correctly, both higher voltage and frequency will drive the EL to put out more light but the trade off is life span of the EL product. The harder you push it, the less time it will last. Also, the inverter and the EL product form an LC circuit and therefore need to be matched to each other somewhat.

    I did not build the inverters but rather purchased them. This project uses both 1.5V and 12V inverters. The 1.5V will drive a strand of EL-wire up to 1.5 feet long and the 12V units will drive up to 15 feet of length.

    I hope to post this in the Completed Projects forum when I get additional programming written and the schematic drawn up. This project is running down to the wire and I'm still writing light patterns as we speak and the costume needs to head out for Trick-or-Treating in a few short hours! If only I had the code writing skills of a few of the folks in our group!! I'm sure that I'm doing this the longest and most difficult way it can be done!!

    My friends 10 year old son will be wearing the costume and he's pretty excited about the whole thing. Both of our families will be walking the neighborhood together this evening and we're all excited!

    Tim

    Post Edited (Tim-M) : 10/31/2008 2:25:52 PM GMT
Sign In or Register to comment.