Go Down

Topic: Shift register woes (Read 561 times) previous topic - next topic

Robert M

Hey guys - I wired up a simple circuit with a shift register - the eventual goal is to connect it to Ardunio.

But I'm having some troubles with the test circuit. First of all, here's the datasheet: http://www.st.com/stonline/books/pdf/docs/1910.pdf

I've wired up the register with 8 LEDs on the 8 outputs, 5v to the Vcc, reset, and two switches - one at the clock pin and one for the two inputs. The LEDs are wired to ground in-series with a resistor

When I switch on my power supply, all the LEDs turn on. Switching the switches doesn't do anything. What I'd like to see is: switch on input and toggle clock, one light comes on. Toggle clock, light advances and finally disappears.

I've gone over the circuit and I can't figure out what could possibly be wrong. Am I misunderstanding something about this component?

Any help is greatly appreciated...

Osgeld

#1
Feb 26, 2010, 11:35 pm Last Edit: Feb 26, 2010, 11:36 pm by Osgeld Reason: 1
the 2 inputs are part of an AND gate, if you just want to toggle tru it try putting one of the 2 inputs (your choice) connected to +5

you should be able to toggle the clock and the remaining input and get the desired effect

I wrote a fairly crappy article on it if your interested

http://www.instructables.com/id/The-74HC164-Shift-Register-and-your-Arduino/
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Robert M

OK, at the moment I've tied both inputs together with a jumper so they're both on or both off. I'm going to add some tracing LEDs to make sure the switches are doing what I want, and I'll read that article as well.

Robert M

#3
Feb 27, 2010, 01:23 am Last Edit: Feb 27, 2010, 01:36 am by slimjim8094 Reason: 1
OK now I'm really confused.

Since it wasn't working anyway, I wired it up to the Arduino - simply replacing my switches with digital pins. shiftOut worked like a dream, as well as bit-banging (digitalWrite(signal, HIGH); digitalWrite(clock, HIGH); delay(10); digitalWrite(clock, LOW);). Again, I didn't have to change anything about the circuit itself.

So I replaced the switches with buttons, in place of the Arduino pins, and got the same problems. Pushing 'clock' with no 'signal' does nothing, but pushing 'signal' then 'clock' turns on all the lights.

Is my finger's "rise time" not fast enough? Is it counting a single button push as a bunch of rises?

Now that I have it working with Arduino I guess I'm in good shape, but I'd like to understand why my circuit isn't working.

Osgeld

could be, switches are very noisy
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Robert M

OK... that was the only reasonable explanation I could come up with for what I was seeing.

I'll try throwing a capacitor between the switch and the clock

Go Up