Go Down

Topic: Basic Shift Register Questions (Read 261 times) previous topic - next topic

Totz

Hii,
Am new to the world of shift register and even to the world of electronics. Please pardon me my questions:

When I set latch pin high and low?
When I set clock pin high and low?
When I set data pin high and low?



Paul__B

Right, we are talking about a 74HC595, a serial-in, parallel-out (SIPO) register.  OK?

Code: [Select]
Strobe (not latch) pin 12 LOW.
Shift clock pin 11 LOW
*  loop starts
Put data bit on data input pin 14
Shift clock pin 11 HIGH, then LOW - data bit shifted in
*  repeat loop to total 8 times, or 8 x number of registers in series
Strobe pin 12 HIGH, then LOW.- data now appears on outputs.

Note these are clocked latches, not level-determined.  Data is transferred as the clock pin goes high, and is not changed afterward.  On a "latch" device by comparison, the output will follow the input while ever the latch is enabled, staying at the last level as soon as the latch is disabled.

CrossRoads

shiftOut() makes this happen for you.

digitalWrite (latchPin, LOW);
shiftOut (dataPin, clockPin, MSBFIRST, your_data_byte); // data is shifted out
digitalWrite (latchPin, HIGH); // data is clocked into the 2nd stage output register on this rising edge
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy