4094 Please Help


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2009
    Posts
    23

    Default 4094 Please Help

    hello
    I wrote this for the 16F877 for 2 4094
    The first 4094 works correctly the second not
    What I do wrong please help
    thanks


    Code:
    INCLUDE "modedefs.bas"
    
    
    TRISC = %00000000         
    
    symbol clock=portc.0
    symbol data_pin=portc.1
    symbol strb=PORTc.2
    symbol data_pin2=portc.3
    
    main:
    high strb
    high data_pin 'FOR STROBE HIGH
    ShiftOut data_pin,clock,1,[%11000011] 
    low strb
    low data_pin
    
    high strb
    high data_pin2
    ShiftOut data_pin,clock,1,[%10000001]                              
    low strb
    low data_pin2
    pause 2000
    goto main
    [IMG][/IMG]

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


    Did you find this post helpful? Yes | No

    Default

    Maybe add this to your code?
    Code:
    ShiftOut data_pin2,clock,1,[%10000001]
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit
    Thank's for your thoughts
    I tried ShiftOut data_pin2,clock,1,[%11000011] but not working properly U2

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    I would recomend seperate control pins for the second 4094 (OE and STRB) with common CLK.

    Or even better, use the two 4094 in chain and feed data to the second Data in out of the first 4094, using common controls as you do now.

    Ten you have to send 16bits of course, before activate outputs.

    Ioannis

  5. #5
    Join Date
    Sep 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hi Ioannis

    You're right it works perfectly
    View circuit and program to Picbasic

    Thank you very much my friend Ioannis

    Code:
    INCLUDE "modedefs.bas"
    DEFINE SHIFT_PAUSEUS 100
    
    TRISC = %00000000         
    
    symbol clock=portc.0
    symbol data_pin=portc.1
    symbol strb1=PORTc.2
    symbol strb2=PORTc.3
    alarm var word
    miso var byte
    
    alarm = %1001100111010111
    miso = alarm>>8
    
    main:
    
    high strb1
    ShiftOut data_pin,clock,0,[alarm\8]                              
    low strb1
    
    high strb2
    ShiftOut data_pin,clock,0,[miso] 
    low strb2
    
    pause 2000
    goto main

  6. #6
    Join Date
    Jul 2008
    Location
    TURKIYE-KONYA
    Posts
    51


    Did you find this post helpful? Yes | No

    Default 1 data , 1 strb , 1 clk and dozens 4094

    HI DOVEGROUP.

    YOU DONT NEED TO USE EXTRA PINS FOR ANOTHER 4094.YOU CAN USE SAME PORTS.

    YOU CAN CONNECT "Qs DATA OUT" TO ANOTHER 4094.

    Code:
    include "modedefs.bas"
    
        ADCON1  = 7
        
        
        
        STRB  VAR  PORTC.2
        DAT   VAR  PORTC.1
        CLK   VAR  PORTC.0
        
        OUTPUT STRB
        OUTPUT DAT
        OUTPUT CLK
        
        DATA_1  VAR BYTE
        DATA_2  VAR BYTE
        
        DATA_1 = %11000011
        DATA_2 = %10000001
        
        
        
        
        MAIN :
        
        SHIFTOUT DAT , CLK , 1,[DATA_2 , DATA_1]
        STRB = 1  : PAUSEUS 100 :  STRB = 0
        
    
        	
    GOTO MAIN
    Attached Images Attached Images  

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    Hmm, although I did proposed that too, dovegroup prefered to do the other way. May be it he needs seperate control over the second chip.

    If there are free pins then it is OK I guess.

    Ioannis

Similar Threads

  1. 16F877 and 4094 please help
    By dovegroup in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 21st May 2014, 13:22

Members who have read this thread : 1

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