74hc595 serial to serial using shiftin
lfreeze
Posts: 174
Can anyone share some code with me? I am attempting to connect a 74hc595 to a [url=mailto:BS2@stampn]BS2[/url]. I am reading clocked data at
a very slow rate into the 595.· My problem is in reading the data out (serial) via Q7'. My objective in this is to save
some stamp pins by reading it out in serial format, instead of parallel. I've read most of the previous posts and can't
find any examples that help. This is really frustrating and I am beginning to think that the 595 chip may be the wrong
selection. Any help would be greatly appreciated
Larry··
a very slow rate into the 595.· My problem is in reading the data out (serial) via Q7'. My objective in this is to save
some stamp pins by reading it out in serial format, instead of parallel. I've read most of the previous posts and can't
find any examples that help. This is really frustrating and I am beginning to think that the 595 chip may be the wrong
selection. Any help would be greatly appreciated
Larry··
Comments
The SHIFTOUT command worked, but I made this up intending to use it with a BS1 (it has no SHIFTOUT.)· My program uses a Button-push for manual Clocking and 'Bit Testing'.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
cascaded into the 595. I thought it would be simpler (less code and wiring) to read it serially at the byte level out to the stamp.
and have the stamp react to the different numbers that would wind up as control character for a variety of tasks.
Would it be easier to use shiftin for each bit and then combine the result as a single byte? If· this is true, I should be able
to remove the 595 completely.
·Larry
You would use a 74595 to output serial from the BS2·SEROUT command.· You would use a ·74165 to input serial into the BS2 with a SERIN command.
Neither chip works with SERIN or SEROUT, rather, both work with SHIFTIN or SHIFTOUT, as appropriate. Both are synchronously serial accessed chips. SERIN/SEROUT is for asynchronous serial accessing.
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 11/15/2005 2:08:13 AM GMT
1.···· load a byte of data· (from an external source) bit by clocked bit into the 595
2.···· store this data for x amount of time.
3.··· ·using the stamp to control the output, read out the data (shiftin) ·as a byte into the stamp
4.··· using the stamp, read the· byte of data and take various actions based on the value of the data
I· thought the 595 would work as the data sheet describes it functionality· as (8-bit serial in, serial or parallel out)
I can get the 595 to work using its parallel output, but my objective is to limit the amount of stamp pins needed
to read the data, and simplify the wiring. I don't have much experience with this and feel frustrated at my inability
to make it work, suggestions are really welcome and appreciated.
Larry,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
Help us to help you -- by posting what you have.
It seems to me that you could effect a serial output from the 74595's Q7 (pin 7 -- or by taking inverted data from pin 9) output by clocking through the bits.· That is, once you have your "8", then Q7 becomes the 1st bit "out" (FIFO'ing: first in, first out), succeeding bits will shift over/through on succeeding CLOCKs.· So,·at the end of 7 CLOCKs further, the last bit of your original "8" will be at Q7.
N.B.,
You'll need to be mindful that·in the process of transferring these bits out, the shift register·will be·taking bits in behind·them, too.
It will acomplish the objective of using fewer stamp pins as compared to connecting the 595 in parallel mode to
the stamp. It will also give me some additional control as I can store the data in the 165 and control the data going
into the stamp via the 165 clock