How is the shift register connected? Inputs pulled high/low, power,etc.
How is the shift register connected? Inputs pulled high/low, power,etc.
Dave
Always wear safety glasses while programming.
well pin 16 is on 5V
pin 1 in D1
Pin 2 in D0
pin 9 is the data
8 in ground CE is ground, and the other 8 input pin some I have on 5v and some on ground .
K
Try pin 7 for the data line to the pic.
Dave
Always wear safety glasses while programming.
And go back to toggle-ing the load line.
Dave
Always wear safety glasses while programming.
Simple explaination based on truth table:
While PL is low, anything that happens on the CP, CE and DS pins is ignored, levels on pins D0-D6 are saved into the internal shift registers, and D7 is saved into the shift register and output on Q7. So PL has to be low at some point in order to load the levels from the D0-D7 pins into the registers
When PL transitions from low to high, the last levels on D0-D7 are latched into the shift registers.
While PL is high, The CP, CE and DS pins start working and anything that happens on the D0-D7 pins is ignored. As long as the CE pin is low, clock pulses on the CP pin will serially shift data though the registers, and then out of the part on the Q7 and (Q7not) pins. The DS pin feeds into the first register and can be used to connect multiple HC165 parts together in a longer chain.
Last edited by falingtrea; - 15th December 2010 at 20:24. Reason: added info
Tim Barr
I think I see some of the problem, sorry I missed it earlier.
ANSELH = 0
should be
ANSEL = 0
And I just tried this on my simulator (bread board) to see if anything else was missing.
Change the PIC ports to match your setup.
Code:'74HC165 CONNECTIONS 'VSS = PIN #8 AND PIN# 15 'VDD = PIN #16 'No Connect = PIN #9 AND PIN# 10 Clock VAR PORTF.6 'PIN #2 74HC165 Load VAR PORTF.7 'PIN #1 74HC165 Data_1 VAR PORTF.5 'PIN #7 74HC165 KEYS VAR BYTE HIGH Load READ_KEYS: PULSOUT Load,1 SHIFTIN Data_1,Clock,0,[KEYS] PAUSE 100 LCDOUT $FE,1,"KEYS= ",BIN8 KEYS GOTO READ_KEYS
Dave
Always wear safety glasses while programming.
that might be just it:
From the datasheet:
Note: The ANSEL register must be initialized to
configure an analog channel as a digital
input. Pins configured as analog inputs will
read ‘0’.
But it also says the same for ANSELH, should I but both of them to 0 ??
Bookmarks