confusion with the CD74HC165 8 bit register


Closed Thread
Results 1 to 30 of 30

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Hi Dave, I can do that, maybe tomorrow, Its only using three ports in my Pic16F887, how hard can it be. I tried to switch to PORTD:
    Clock var PORTD.0 'CP
    Load var PORTD.1 'PL
    Data_1 var PORTD.2 'Q7 out
    But no luck either Maybe the CD4014BE will be easier ??

    ken

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    How is the shift register connected? Inputs pulled high/low, power,etc.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Try pin 7 for the data line to the pic.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    And go back to toggle-ing the load line.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I will do it tonight, I think this is the inverted output

  7. #7


    Did you find this post helpful? Yes | No

    Default

    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

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    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.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts