Go Down

Topic: simple explanation of shift register use. (Read 4479 times) previous topic - next topic

Boffin1


I had to try and explain what a serial in parallel out shift register does, and came up with this, which might be of some use to newcomers.

A postman ( mailman ) has to deliver 10 parcels to 10 houses in a row, he can only carry one at a time, so to save a lot of walking,  he comes up with the idea of parking at the end house and tooting his horn ( taking the latch pin low ) to call the people out of their houses to their front gardens.

He then gives the parcel for the furthest house to the lady at the first house, and asks her  ( taking the shift register clock high and low again ) to pass it to the next lady.

He then gives her the second parcel and shouts to everyone to pass them on ( pulsing  the shift clock again )

When all the parcels have been passed out , he tells them to take them indoors and open them ( by taking the latch pin high again )

In practice this save a lot of wiring ( walking )  and a great many devices can be connected to shift data to the right device, such as LED displays which would need thousands of individual wires to light the correct patterns.
With my mobile phone I can call people and talk to them -  how smart can you get ?

PaulS

Would be a really nice analogy if there were 10 input bits/10 output lines. But, there probably aren't.

retrolefty

Not bad. And an example of using arduino output pins directly would be sending 10 postmen out each with one package to deliver at nearly the same time, much faster but uses up resources (mailpersons/trucks = pins used).


CrossRoads

Okay PaulS, how about 16 bits then?

http://www.maxim-ic.com/datasheet/index.mvp/id/4809/t/al
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.

Boffin1

You could with a bit of imagination having the people swapping parcels with ones to be posted, going the other way in a SPI fashion?
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

Yes, that'd be a shift-in register. Parallel load, serial shift in.
74AC299 is nice chip, can do both, and shift left or right.
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.

Boffin1

I was thinking of the MISO  MOSI  action of swapping parcels.
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

Ok, that's the built-in hardware version of shiftout () or shiftin(). 
Same concept of passing out one at a time, or collected  many at a time but turned in 1 by 1.
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.

Boffin1

Yes,  its probably getting away from my original " Harry Potter does Arduino" explanation for absolute beginners :-)
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up