AtomSoft
Well-Known Member
Hey i got a theory again... Using this SN74LS165 "8-Bit Parallel-to-Serial Shift Register" i want to have buttons connected to it to turn my signal into a digital signal by it sending the serial data to the pic from the 8 parallel inputs. Heres how i think it would work...
From Datasheet:
so i can set the CP1 & CP2 at the same time with a transistor(or 2).
Then i read:
Meaning i should set the PL high when changing the Parallel data. (unless i follow timing)
So i would set PL high (pull up High) with a transistor which is triggered from a pullup to VCC so its always high until i press button which triggers the transistor to connect VCC to CP1 & CP2 and another transistor to tie GND to PL this way when i press the button this happens:
CP1 = HIGH
CP2 = HIGH
PL = LOW
Px (parallel pin x) = High
when no button pressed:
CP1 = LOW
CP2 = LOW
PL = HIGH
Px (parallel pin x) = LOW
If i have 4 buttons then if i press the third button it should send the above(you know which one) and the Serial out should then be
3rd button
HIGH NYB - LOW NYB
0000 - 0100
2nd button
HIGH NYB - LOW NYB
0000 - 0010
1st button
HIGH NYB - LOW NYB
0000 - 0001
4th button
HIGH NYB - LOW NYB
0000 - 1000
Understand? I havent done it its theory .. do you think it would work?
From Datasheet:
"For clock operation, PL must be HIGH. The two clock
inputs perform identically; one can be used as a clock inhibit
by applying a HIGH signal. To avoid double clocking,
however, the inhibit signal should only go HIGH while the
clock is HIGH."
so i can set the CP1 & CP2 at the same time with a transistor(or 2).
Then i read:
Parallel data enters when the PL signal is LOW. The parallel data can
change while PL is LOW, provided that the recommended
setup and hold times are observed.
Meaning i should set the PL high when changing the Parallel data. (unless i follow timing)
So i would set PL high (pull up High) with a transistor which is triggered from a pullup to VCC so its always high until i press button which triggers the transistor to connect VCC to CP1 & CP2 and another transistor to tie GND to PL this way when i press the button this happens:
CP1 = HIGH
CP2 = HIGH
PL = LOW
Px (parallel pin x) = High
when no button pressed:
CP1 = LOW
CP2 = LOW
PL = HIGH
Px (parallel pin x) = LOW
If i have 4 buttons then if i press the third button it should send the above(you know which one) and the Serial out should then be
3rd button
HIGH NYB - LOW NYB
0000 - 0100
2nd button
HIGH NYB - LOW NYB
0000 - 0010
1st button
HIGH NYB - LOW NYB
0000 - 0001
4th button
HIGH NYB - LOW NYB
0000 - 1000
Understand? I havent done it its theory .. do you think it would work?