confusion with the CD74HC165 8 bit register


Closed Thread
Results 1 to 30 of 30

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    putting the PL low .. something like that ??
    I would do this (and make sure the CE pin is pulled low always) :
    Code:
    TRISE = %11111100 	' Set PORTE to all input
                
    Clock   var PORTE.0   'CP
    Load    var PORTE.1   'PL
    Data_1  var PORTE.2  'Q7  out
    input1 var byte
    
    low Load
                 
    Mainloop:
    
      high Load
      shiftin Data_1,Clock,0,[input1 \8]
      low Load
    
      lcdout $FE,1, "Shift in"
      lcdout $FE,$C0, dec2 input1
      pause 300
    			
    GOTO Mainloop
    End
    Last edited by falingtrea; - 14th December 2010 at 19:51. Reason: spelling error
    Tim Barr

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Hi I just tried your program modification and it do not work. Also some people say here it should be high and you say it should always be low, this is confusing.

    Code:
    '/////////////////////////
    '//  test program
    '//	Using the PIC16F887
    '/////////////////////////
    
    '/////////////////////////
    '// Define section //
    '/////////////////////////
    include "modedefs.bas"
    
    OSCCON = %01110000 '8 Mhz
    DEFINE OSC 8
    ANSELH = 0
    
    
    '/////////////////////////
    '// LCD configuration //
    '/////////////////////////
    
    DEFINE LCD_DREG PORTB 	' Set LCD Data port
    DEFINE LCD_DBIT 4 		' Set starting Data bit (0 or 4) if 4-bit bus  RB.4, RB.5, RB.6, RB.7
    DEFINE LCD_RSREG PORTB 	' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 		' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB	' Set LCD Enable port
    DEFINE LCD_EBIT 0 		' Set LCD Enable bit
    DEFINE LCD_BITS 4 		' Set LCD bus size (4 or 8 bits) '4 therefore put wire at 4, 5, 6 and 7 of LCD
    DEFINE LCD_LINES 2 		' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250
    DEFINE CHAR_PACING 2000
    pause 500
    
    
    TRISE = %11111100 	' Set PORTE to all input
                
    Clock   var PORTE.0   'CP
    Load    var PORTE.1   'PL
    Data_1  var PORTE.2  'Q7  out
    input1 var byte
    
    low Load
                 
    Mainloop:
    
      high Load
      shiftin Data_1,Clock,0,[input1 \8]
      low Load
    
      lcdout $FE,1, "Shift in"
      lcdout $FE,$C0, dec2 input1
      pause 300
    			
    GOTO Mainloop
    End

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Hum, I tried pretty much every combination with High, Low PL, Pauses, whatever I could think about. Change HC165, maybe it could be defect. Nothing, still showing Zero as my output.

    K

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


    Did you find this post helpful? Yes | No

    Default

    Can you post a schematic?
    Dave
    Always wear safety glasses while programming.

  5. #5
    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

  6. #6
    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.

  7. #7
    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

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