Example code for 74hc595
azmax100
Posts: 173
hi
Can sombody show me some example with shiftout from BS2 to 74hc595.
I want to use·2 of ·74hc595 to drive some relay (about 16 of them)·trough 2 of uln2803.
I've view the example in Stampworks manual but it's too brief for me to understand.
I dont need full code just some example so i can learn·from it.
Thanks & regards·
Can sombody show me some example with shiftout from BS2 to 74hc595.
I want to use·2 of ·74hc595 to drive some relay (about 16 of them)·trough 2 of uln2803.
I've view the example in Stampworks manual but it's too brief for me to understand.
I dont need full code just some example so i can learn·from it.
Thanks & regards·
Comments
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
The Stamp Works Manual has examples connecting one or more 74HC595 chips. You can find the manual and downloadable source code on the following page. Take care.
http://www.parallax.com/detail.asp?product_id=27297
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thanks Newzed for the example.
[noparse][[/noparse]'Now suppose we want to make pins Qa, Qb, Qd and Qh all high to turn on 4 Darlingtons
'at once.· We are using lsbfirst, so the first bit out goes to Qh and the last bit
'out goes to Qa.· In binary, we would want to send %11010001.· However, you can use
'either binary or decimal - it doesn't matter.· After all, the decimal gets converted
'to binary by the Stamp before it is transmitted.· So %11010001 = 128+64+16+1=209
LOW latch
SHIFTOUT dat, clk, LSBFIRST, [noparse][[/noparse]209]
PULSOUT latch, 5
LOW latch
'The four outputs pins will stay high until you turn them off or power down
GOTO start]
Now I understand better but how to make the pin low. let say i want to make pin Qb high for 100us can I do this?
LOW latch
SHIFTOUT dat, clk, LSBFIRST, % 01000000
PULSOUT latch, 5
PAUSE 100
LOW latch
Is it right? Sorry for dumb question. I'm a self learner.
Chris thanks for the link. actually I already read it but not quite understand cause it's too brief.
·
LOW, simply send a 0 to that pin.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Thanks newzed.
To make the output high send %1
to make the output low send %0
That simple. How come I did't think of that.