will this simple circuitry work?

Discussion in 'The Projects Forum' started by ernestclydeachua, Aug 26, 2012.

Thread Status:
Not open for further replies.
  1. ernestclydeachua

    Thread Starter New Member

    Aug 5, 2012
    16
    0
    hi i made a relay driver i want some suggestions

    heres the code
    Code ( (Unknown Language)):
    1. ;RB0 controls RB7 and RA0
    2. ;RB0=0 then RB4 and RA0=0, else it will be 1 when RB0=1
    3. ;RB1 controls RB5 and RA1
    4. ;RB2 controls RB6 and RA2
    5. ;RB3 controls RB7 and RA3
    6.  
    7.     list      p=16F84A            ; list directive to define processor
    8.     #include <p16F84A.inc>        ; processor specific variable definitions
    9.     errorlevel -302, -207  
    10.  
    11.     __config _CP_OFF &_XT_OSC & _PWRTE_ON & _WDT_OFF
    12.  
    13. cntr1   equ h'21'
    14. cntr2   equ h'22'
    15. bfr1    equ     23h
    16.  
    17.     ORG     0x000             ; processor reset vector
    18.     goto    main              ; go to beginning of program
    19.  
    20.     ORG     0x004             ; interrupt vector location
    21.     nop
    22.     retfie                    ; return from interrupt
    23.  
    24. main:
    25.     bsf STATUS,RP0
    26.     movlw   b'00000000'
    27.     movwf   TRISA
    28.     movlw   b'00001111'
    29.     movwf   TRISB
    30.     bcf STATUS,RP0
    31.  
    32. newloop:
    33.     movf PORTB,W
    34.     movwf bfr1
    35.     movf bfr1,W
    36.     movwf PORTA
    37.     rlf bfr1,F
    38.     rlf bfr1,F
    39.     rlf bfr1,F
    40.     rlf bfr1,F
    41.     movf bfr1,W
    42.     movwf PORTB
    43.     goto newloop   
    44.  
    45.     end

    and here is the schematic

    [​IMG]
     
  2. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    No schematic is posted.
     
  3. ernestclydeachua

    Thread Starter New Member

    Aug 5, 2012
    16
    0
    just right click and open in a new tab
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
  5. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
Loading...
Thread Status:
Not open for further replies.