74165 Serial Input Question
Joms
Posts: 279
At one time I was able to make this work, now I can't seem to make this circuit work correctly and I am sure I am just overlooking a small detail.· What the end goal is, I want to take a 5 position BCD digital input to a 74165 shift register and make it appear as a decimal number to the stamp.· Because I can't get this circuit to work I have started over with only this part in the program.· I have attached my current program if someone can look at it and give me an idea of what I am overlooking.· It will only display bit0 on the debug...
The wiring is:
Pin 0 - Shift/Load
Pin 1 - Clock
Pin 2 - Data to Stamp from 74165
Thanks in advance for any help...
The wiring is:
Pin 0 - Shift/Load
Pin 1 - Clock
Pin 2 - Data to Stamp from 74165
Thanks in advance for any help...
bs2
472B
Comments
serial VAR Byte
stored VAR Byte
shift VAR Nib
OUT0=1
OUT1=1
Main:
PULSOUT 0, 5 ' load the inputs
serial.BIT0 = IN2
PULSOUT 1, 5 ' clock out the next bit
serial.BIT1 = IN2
PULSOUT 1, 5 ' clock out the next bit
serial.BIT2 = IN2
PULSOUT 1, 5 ' clock out the next bit
serial.BIT3 = IN2
PULSOUT 1, 5 ' load the inputs
serial.BIT4 = IN2
PULSOUT 1, 5 ' clock out the next bit
serial.BIT5 = IN2
PULSOUT 1, 5 ' clock out the next bit
serial.BIT6 = IN2
PULSOUT 1, 5 ' clock out the next bit
serial.BIT7 = IN2
IF serial = stored THEN
GOTO Main:
ELSE
Stored = Serial
ENDIF
DEBUG CLS
DEBUG DEC serial
· PAUSE 100
· GOTO Main
· END
http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf