16F877 and 4094 please help


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    May 2014
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: 16F877 and 4094 please help

    Hi,
    I am inexperienced still in picbasic but I try
    Reading her user guide, and studying examples of code

    I noticed in this post the code from aratti, It is exactly what I need (thank you very much aratti)
    I used him as a basis, and I made changes so that him I adapt in my work

    Here I would want your help, so that I use also port C from the 16F876, so that I increase the inputs (push button) circuit in 16

    Thank you in advance
    regards

    Here it is the code and the circuit, that works perfect
    Code:
    DEFINE OSC 10
    DEFINE SHIFT_PAUSEUS 100
    
    
    TRISA = %00000000
    TRISB = %11111111 
    TRISC = %00000000
    ADCON1 = 7
    '************************************        
    alarm var BYTE
    Flag   var BYTE
    bleg   var word
    B0      var word
    '************************************
    Symbol data_pin=PORTA.0
    Symbol clock=PORTA.1
    Symbol strb=PORTA.2
    Symbol oe=PORTA.3
    '************************************
    alarm=0
    Flag = 0
    B0 = 0
    bleg= 900
    portC = %00000000
    
    '************************************
    
    
    start:
    
    oe= 0:pause bleg
    
    B0 = PortB & %11111111
    Alarm = (0 + B0) * 1
    If Alarm <> Flag then gosub Print
    oe= 1:pause bleg
    goto start      
    
    '************************************
    Print:
    
    ShiftOut data_pin,clock,1,[alarm]                              
    strb = 1  : PAUSEUS 100 :  STRB = 0
    Flag = Alarm
    return
    
    end
    Name:  alarm-sch.png
Views: 1623
Size:  10.7 KB

  2. #2
    Join Date
    Sep 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Default Re: 16F877 and 4094 please help

    Hi Anatoli

    I am not guru in picbasic I will try to help you, with those who I know
    It tryed these changes

    Code:
    DEFINE OSC 10
    DEFINE SHIFT_PAUSEUS 100
    
    
    TRISA = %00000000
    TRISB = %11111111 
    TRISC = %11111111
            
    alarm var word
    Flag   var BYTE
    bleg   var word
    B0      var word
    C0      var word
    '************************************
    Symbol data_pin=PORTA.0
    Symbol clock=PORTA.1
    Symbol strb=PORTA.2
    Symbol oe=PORTA.3
    '************************************
    alarm=0
    Flag = 0
    B0 = 0
    C0 = 0
    bleg= 500
    portC = %00000000
    ADCON1 = 7
    '************************************
    
    
    start:
    
    oe= 0:pause bleg
    
    B0 = PortB & %11111111
    C0 = PortC & %11111111
    Alarm = (0 + C0) * 1  & Alarm = (0 + B0)
    If Alarm <> Flag then gosub Print
    oe= 1:pause bleg
    goto start      
    
    '************************************
    Print:
    
    ShiftOut data_pin,clock,1,[alarm\8]   
                           
    strb = 1  : PAUSEUS 100 :  STRB = 0
    Flag = Alarm
    return
    
    end

  3. #3
    Join Date
    May 2014
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: 16F877 and 4094 please help

    Hi dovegroup

    I thank you for your help, him I tryed
    the second IC-4094 works rightly, but the first IC-4094 does not works any output

  4. #4
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: 16F877 and 4094 please help

    It looks like you're using Proteus and simulating the project. If so, and maybe not, you've assigned D9 to two chips which I'm assuming are the 4094. Change one or the other to something else and hook something up to the lower chip. Then see what you've got.

Similar Threads

  1. 4094 Please Help
    By dovegroup in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 10th September 2009, 13:11

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