greets
I've got a CD4014BE shift register that I want to use with 8 switches. I've found some code online but unfortunately it is not helpful for understanding how the shift register works.
So I decided to build a simple circuit with switches connected to the Serial Load, Paralel/Serial Enable and the Clock pins, and to the input pins. Basically I'm duplicating what a MCU does but at very slow speed.
I did this before with a 74HC164 shift register and it clarified for me how it functions, but with the CD4014 it's a different story.
Data Sheet for the CD4014: http://www.unisonic.com.tw/datasheet/CD4014B.pdf
The schematic of my breadboard circuit (see attach): (the pull-down resistors, debouncing caps and current limiting resistors are omitted on the image but present in the circuit).
Here's how I use the switches to duplicate what the MCU does:
(the Serial Input is LOW at all times, I'm not daisy chaining (yet)).
- PE (parallel enable - pin 9) - HIGH
- Input(s) n - HIGH ( I did this with one of the 8 inputs and in another test with two inputs simultaneously)
- CLK - HIGH then LOW (this is CLK pulse #1)
- Input(s) n - LOW
- PE - LOW
- CLK - HIGH then LOW (CLK pulse #2)
- CLK - HIGH then LOW (CLK pulse #3)
- CLK - HIGH then LOW (CLK pulse #4)
- CLK - HIGH then LOW (CLK pulse #5)
- CLK - HIGH then LOW (CLK pulse #6)
- CLK - HIGH then LOW (CLK pulse #7)
- CLK - HIGH then LOW (CLK pulse #8)
then repeat the same steps again over and over. While doing the tests I wrote down the output state of Q8.
I'm not sure if this is the correct way to do it but I got some results that I don't understand.
According to the output table (image CD4014 - Q8 output.jpg) setting input 1 or 2 or 3 HIGH yields the same result at Q8, i.e. :
CLK#1 - 0
CLK#2 - 0
CLK#3 - 0
CLK#4 - 0
CLK#5 - 0
CLK#6 - 1
CLK#7 - 0
CLK#8 - 0
also the combination of Inputs 1+3 HIGH is the same as Input 1 HIGH,
also Inputs 2+4 is the same as Input 4, and so on....
I don't now if my method is correct but if it is, how does the MCU know whether it was input 1, 2 or 3 that went HIGH?
What does Q1(Internal) mean?
What does Qn-1 do?
thanks in advance
p.s. I've just updated the schematic image. The first one was wrong, the 8 input switches should be connected to VDD, not ground.