Shop OBEX P1 Docs P2 Docs Learn Events
Need some help with DIO board and Stamp. — Parallax Forums

Need some help with DIO board and Stamp.

ColtColt Posts: 24
edited 2010-11-23 23:45 in BASIC Stamp
I'm needing a little help. I havn't messed with a Stamp in a long time, but even when I was messing with it all the time, this is still something I'd have trouble with..

I've been messing with the DIO board, and I'm trying to get familar with it so I can use it in a real world application, several of them actually..

Right now I'm working on the Pro. Dev. Board. I'm using the serial interface to the HC595 on the DIO board. It's setup so that when I either push a button, or turn a dipswitch on it will ask the HC595 to trigger a relay.. The issue is when I ask for more than one, it will not keep the previous relay energized ( well it does, but it "flutters" the relay )

I know exactly why. It's because it's sending the data to the HC595, but it's clearing out my previous command.. So what I need to do is when it's updating the HC595, it also sends the previous command..

Such as, when IN14 is high, energize the relay, then once IN15 is high, energize that relay, while keeping the first 1 energized as well..

I know I need to write to the EEprom, and thats where I'm lacking. I could do it, if I had the slightest idea of what I actually need to do.. I'd really appreciate some insight into this, I'm sure it's a easy solution, but the fact is I have no clue how to accomplish this. I've attached the code, it's pretty rough since I've just been playing around with it, but will give a good idea as to what I'm actually tying to do... I'll actually be using a Prop in the end, but I'm just getting started with that, so I wrote the code for the Stamp since I knew I could do it quickly, and it would be easier for me to understand and work out the bugs.

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-11-23 05:02
    One way to deal with your problem is to just keep track of how many relays should be on and send the control pattern to keep all required outputs turned on.

    For instance if %00000001 turns on relay #1 and %00000010 turns on relay #2, then to turn both on you'd send %00000011.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-11-23 09:52
    Colt wrote: »
    I'm needing a little help. I havn't messed with a Stamp in a long time, but even when I was messing with it all the time, this is still something I'd have trouble with..

    I've been messing with the DIO board, and I'm trying to get familar with it so I can use it in a real world application, several of them actually..

    Right now I'm working on the Pro. Dev. Board. I'm using the serial interface to the HC595 on the DIO board. It's setup so that when I either push a button, or turn a dipswitch on it will ask the HC595 to trigger a relay.. The issue is when I ask for more than one, it will not keep the previous relay energized ( well it does, but it "flutters" the relay )

    I know exactly why. It's because it's sending the data to the HC595, but it's clearing out my previous command.. So what I need to do is when it's updating the HC595, it also sends the previous command..

    Such as, when IN14 is high, energize the relay, then once IN15 is high, energize that relay, while keeping the first 1 energized as well..

    I know I need to write to the EEprom, and thats where I'm lacking. I could do it, if I had the slightest idea of what I actually need to do.. I'd really appreciate some insight into this, I'm sure it's a easy solution, but the fact is I have no clue how to accomplish this. I've attached the code, it's pretty rough since I've just been playing around with it, but will give a good idea as to what I'm actually tying to do... I'll actually be using a Prop in the end, but I'm just getting started with that, so I wrote the code for the Stamp since I knew I could do it quickly, and it would be easier for me to understand and work out the bugs.
    '
    I wouldn't try to use the EEprom to buffer with.
    '
    Take a look at Experiments #23,24,25 in the StampWorks Manuel.
    '
    http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf
  • ColtColt Posts: 24
    edited 2010-11-23 23:45
    Thanks for the replies guys..

    I read those sections in the Stamp Works Manual.

    It works with the HC165, as would be expected. All I did was modify the DIO board example code, which is simple enough.

    For now while testing that's plenty. As I work towards the final application it wont work because many of the inputs will not be a simple on/off circuit. Some will depend on other conditions to be met, some will be time based after a button is pushed. Right at this point I'm not sure how to do any of those things while using the HC165 and the HC595, but I'm going to work with it before I ask questions.

    As for the applications I intend to use the DIO board in, one will be controlling many of the circuits in my drag car. The other is for a automatic start stop AC/DC generator ( 4K gen head as well as a 105 amp alternator ). It will control the engine operation ( the choke, cranking, engine speed, you name it, everything ). And my race car trailer, the trailer is setup to run off a bank of batteries, using a inverter for AC power. The generator I've built will be mounted to that trailer, and will monitor all power demands. The 4K gen head is for loads too large for the inverter. The Prop ( for right now the Stamp ) will even control the air conditioner and how the generator interfaces with it.. It's going to be a cool little project. I've already done all of the leg work for the voltage and current monitoring, just needs "tuning" for the real world. Engine operation still needs to be done, but thats easy. There is nothing I hate more than running a AC generator for light loads, it's wasteful, so this is my solution. Once it's operational I'll build another for my work truck, running lights and such at night, where otherwise I have to run the truck engine.

    Anyways, thanks again... I've attached the modified example code for future reference. It just takes the example code, and modifies it so that the inputs from a dip switch or whatever controls the output of the relays. Instead of the relays energizing in a binary pattern. I forgot to add that Pin15 goes high to turn on logic power, otherwise everything is the same, I didnt put in any comments since this was just for testing on my part. Hopefully it will help someone in the future :D
Sign In or Register to comment.