Shop OBEX P1 Docs P2 Docs Learn Events
expanding I/O's — Parallax Forums

expanding I/O's

Dan990Dan990 Posts: 13
edited 2010-04-26 03:49 in BASIC Stamp
i was wondering if i can expand I/O's or just the outputs with a 8-Bit Serial-Input Latched Drivers. and if i can what the code would look like.

MIC5841/5842
http://www.datasheetarchive.com/pdf-datasheets/Datasheets-18/DSA-354088.pdf

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-11 22:26
    These look like a combination of a 74HC595 serial input / parallel output shift register with a ULN2803A Darlington Array. I suspect that any code written for the 74HC595 should work. These are output-only registers.

    Look in the StampWorks Manual for sample code. It's available for free download from Parallax. Do a search in their webstore for StampWorks.
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-12 17:23
    Dan990 said...
    i was wondering if i can expand I/O's or just the outputs with a 8-Bit Serial-Input Latched Drivers. and if i can what the code would look like.

    MIC5841/5842
    http://www.datasheetarchive.com/pdf-datasheets/Datasheets-18/DSA-354088.pdf
    Heh... yep it works i just used that technique to run a dishwasher with a Bs1-ic.......

    Just to amplify what Mike said....
    http://www.datasheetarchive.com/pdf-datasheets/Datasheets-18/DSA-354088.pdf
    That's the stampworks manual you need.· Page 139 of the pdf is page 130 of the manual itself
    and that's example#23. BUT it's for the bs2...

    Bs2 has the Shiftout command that simplifies things....
    Bs1 doesn't but there's a sweet method that utilizes bit acess from b0 or b1.

    I got it from one of the old bs1 news-articles....if you need the exact one (there's SO many) let me know.... I have it saved in my dishwasher notes....

    for the Bs1...
    I·used··>> pin0-DatOut· pin1-clock· pin2-Latch/strobe
    I set Byte0 to the appropriate data out (you can still use bits0-7)
    Program snippet
    FOR x=1 TO 8
    · pin0 = BIT7
    · PAUSE 20 'give pin a moment to change?
    · PULSOUT 1 ,80000 'shift data into register
    · Settings = Settings * 2
    NEXT
    PULSOUT 2 ,8000 'shift complete...latch data to outputs
    Multiplying settings by 2 shifts the data so that MSB is going out thru Bit 7
    you could divide settings * 2 to let the data go LSB thru bit 0

    Looks like·the way that chip you're using goes...
    ·it's proabably MSB you want...unless you hardwire the other way.

    But I LIKE the built in darlington of that chip.... definitely simplfies...



    ·
  • Dan990Dan990 Posts: 13
    edited 2010-04-12 20:19
    ok thanks. and by the way you just posted the datasheet for my chip. and not the manual
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-12 21:01
    Dan990 said...
    ok thanks. and by the way you just posted the datasheet for my chip. and not the manual

    heh...oops....
    was working on 3-4 things...was it obvious?
    Anyway.. thanks for covering for me Hover!
  • Dan990Dan990 Posts: 13
    edited 2010-04-21 12:59
    thank you very much. it worked. although i would also like to ask if there is an easy way to shrink my code down. cause i am using it for a light show and i have to fit as much on it as possible. thanks.
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-21 14:08
    Yeah sure, I just CRAMMMED a dishwasher into a bs1.
    So I feel your pain.
    Gonna need yer code tho!· Attach it wilya?

    Did I mention I added water heating?·

    (The unit·had the ability, (& the temp sensor)·but since we didn't pay the xtra $50.· It wasn't programmed in. . . . hmp.· Hapless consumer indeed.)



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-21 14:50
    One of the Nuts & Volts uses the Eprom to run a traffic lighting system in a "drum" sequence...
    (Ok...it's·#110 june 2004...just use the link above...)

    Includes·a method for manual stepping &..
    ·A potentiomer to control speed (Well, slow down from max anyway.)

    We ended up using lookup & loop counting to control timing.
    Lookup was a bit more visual & since the editor allows for Constants
    ·· ·that DON'T affect memory. Once compiled......Far more elegant

    lookup Timindex,(byte/word(0),byte/word(1),....),Drumout

    But to be fair.... I'm based on constant timing and not variable per Step.
    The method they use DOES allow for individual timing values to be added to each output.

    OH!! and WHERE did you get that IC?· I've looked around a bit...I'm unsucessful at finding a proper supplier for hobbyists.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown

    Post Edited (sumdawgy) : 4/21/2010 4:08:18 PM GMT
  • Dan990Dan990 Posts: 13
    edited 2010-04-21 20:27
    i will post the code when i am finnished it. and sorry i cant help you find the IC i have because it came out of an old vending machine my school had lying around. i was thinking for my code have a bunch of sub sections that i call apon when they are needed. i was thinking and doing this by using an IR detector so i only take up one pin. but now my problem is that now i need to figure out how to send an ir signal from my computer. if you have any ideas i would be happy to hear them. also i would need it to be automatic so i dont have be at the computer.
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-22 02:49
    Dan990 said...
    i will post the code when i am finnished it. and sorry i cant help you find the IC i have because it came out of an old vending machine my school had lying around. i was thinking for my code have a bunch of sub sections that i call apon when they are needed. i was thinking and doing this by using an IR detector so i only take up one pin. but now my problem is that now i need to figure out how to send an ir signal from my computer. if you have any ideas i would be happy to hear them. also i would need it to be automatic so i dont have be at the computer.
    Ok a few things......
    1--Even if you don't post code but post a program outline....would help with helping you.

    2--Ir signal is easy...but what for?· triggering music start?
    · --you could use a photoresistor taped to a spot of monitor that triggers a low/high to fire the sequence...
    ···· (edit the music to a vid that lights the spot u choose.· could use to trigger steps too... Or synch major sections)
    · --you could use scroll lock light to trigger photoresistor·too. (programatically)


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
  • hover1hover1 Posts: 1,929
    edited 2010-04-22 12:52
    You can get the chip at Digi Key. Minimum quatity is one piece.
    http://search.digikey.com/scripts/DkSearch/dksus.dll?lang=en&site=US&WT.z_homepage_link=hp_go_button&KeyWords=MIC5841&x=27&y=23
    Jim
    sumdawgy said...



    OH!! and WHERE did you get that IC?· I've looked around a bit...I'm unsucessful at finding a proper supplier for hobbyists.
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-23 04:01
    hover1 said...
    You can get the chip at Digi Key. Minimum quatity is one piece.
    Thanks hover.· I've been there but never bought from them... Don't shop strange places w/o paypal or trusted word of mouth.· But, I've "heard" them mentioned here a few times. as well...and I want a couple of those chips....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
  • Dan990Dan990 Posts: 13
    edited 2010-04-23 22:11
    sumdawgy said...
    2--Ir signal is easy...but what for? triggering music start?
    --you could use a photoresistor taped to a spot of monitor that triggers a low/high to fire the sequence...
    (edit the music to a vid that lights the spot u choose. could use to trigger steps too... Or synch major sections)

    i was wondering if i can do that but have it tell the difference between colors. so if a certain color appears it will go to a certain part of the code.
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-24 03:13
    Dan990 said...
    sumdawgy said...
    2--Ir signal is easy...but what for? triggering music start?
    --you could use a photoresistor taped to a spot of monitor that triggers a low/high to fire the sequence...
    (edit the music to a vid that lights the spot u choose. could use to trigger steps too... Or synch major sections)

    i was wondering if i can do that but have it tell the difference between colors. so if a certain color appears it will go to a certain part of the code.
    Yeah but....not with a photoresistor.· If you set· baseline for 100% brightness you could... use the resistor to adjust a voltage into a ADC.· Then you could read the voltages· (greyscale recommended)·to point to a routine.

    Parallax also sells a color & light sensor....TCS3200-DB Color Sensor.· If there are other prepackaged solutions..I've not used or seen them so.....

    One Two other ideas that comes to mind..using a 8 bit to serial and· some photoresistors fitted w/color filters tightly packed together. this would allow for some flexibility. Using 3 in a·rgb scheme each feeding an ADC....would approximate a color sensor after you set your baselines.· But if you just used RGB in a binary on/off you get 23 (8) combinations ...or 8 modes .....





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
  • Dan990Dan990 Posts: 13
    edited 2010-04-25 15:02
    well i have no idea how i am going to do this code. if anyone wants to help go right ahead. i just cant figure out how i am gonna call different parts of the code. i like sumdawgy's idea with the the photorsistor. if anyone has any other ideas let me know. it will be much apreciatted.
  • sumdawgysumdawgy Posts: 167
    edited 2010-04-26 03:49
    Well, I am willing to help.... but I need you to "stay the course" as it were.
    This project can be completed...but you'll need 2 skills.
    1-The ability to build the circuit.
    2-The ability to build the program.

    Even with help... you'll need a minimum ability in both categories.
    So, if u at minimum provide an program flow outline.....I'll work with you.
    .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
Sign In or Register to comment.