Advertisement
Guest User

Untitled

a guest
Feb 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    
  2. #include <p16F84a.inc>   ; processor specific variable     ; definitions
  3.  
  4. __CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
  5.  
  6. CBLOCK  0x0c
  7.         COUNT_I
  8.         COUNT_J
  9.         COUNT_k
  10.  
  11. ENDC
  12.  
  13. org 0x00
  14.  
  15. bsf STATUS ,RP0
  16. bcf TRISB ,3
  17. bcf TRISA ,2
  18. bsf TRISA ,3
  19. bsf STATUS ,RP0
  20. clrf PORTB
  21. CLRf PORTB
  22.  
  23. MAIN
  24. movlw 0x04
  25. movwf COUNT_k
  26.  
  27. MAINLOOP
  28.  
  29. btfsc PORTA ,3
  30. call delay
  31. btfsc PORTA ,3
  32. comf PORTA,2
  33. btfsc PORTA ,3
  34. goto lamba
  35. goto MAINLOOP
  36.  
  37.  
  38. lamba DECFSZ COUNT_k ,F
  39. bsf PORTB ,3
  40. goto MAINLOOP
  41.  
  42. delay movlw d'200
  43. movwf COUNT_I
  44.  
  45. loop_I
  46. movlw d'166
  47. movwf COUNT_J
  48.  
  49. loop_J
  50. decfsz COUNT_J ,F
  51. goto loop_J
  52. decfsz COUNT_I ,F
  53. goto loop_I
  54. return
  55.  
  56. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement