EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: King_bob on February 08, 2014, 10:12:55 pm
-
Hi,
I am having issues reading the data out of a 74HC165 shift register. Initially I had it hooked up to an attiny85, but I couldnt seem to get the correct reading, so I broke it down to the most basic possible schematic. I am completly a newb at electronics so dont hurt me too much ;D
(resistors in image are 10k not 220)
(http://kbob.dyndns.org/74HC165_ManualTest_bb.jpg)
The output (Q7) on which the led is connected flickers randomly, when I dont press anything. also pressing the PL and CL as follows:
PL:HIGH
PL:LOW
PL:HIGH
LED should show DIP 1
CL:HIGH
CL:LOW
LED should show DIP 2
does not deliver the expected results, but allways delivers random results each time.
Any ideas on where the problem ist?
I solved the flickering by adding a pulldown on pins 1&2, but the data is still not coming out quite correctly.
-
Some things, one of which you have discovered:
74HC inputs are very high impedance and will pick up random rubbish if left unconnected. Pins 1&2 weren't connected to anything unless the switches were pressed - this is why you needed to add resistors.
PL (pin 1) is active LOW so you need to pull it UP and have the switch ground pin 1
You don't have any debounce - when you push the switch the 74HC165 will actually see several pulses. Google switch bounce or look through the forum as there were some threads recently on this subject.
Oh, and you don't have any decoupling which is probably not significant but it never hurts to add 0.1uF or so close to each IC between VCC and ground.
-
Probably Fritzing : http://fritzing.org/home/ (http://fritzing.org/home/)
-
yes the picture is made with fritzing, as for the switch bounce, I have the problem regardless wheather I use buttons or attiny85, one strange issue is that when D0 gets set to HIGH Q7 (data out) also goes high, regadles of the load or clock.
EDIT: Problem has been solved, Thanks
-
EDIT: Problem has been solved, Thanks
And the problem was.....?
-
switch bounce was the first problem, then after attachting the attiny again, I had a small code issue, unfortunately pin 8 is still a problem, but that is something that I can ignore.