Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pic 16 1.22 KB | None | 0 0
  1. #INCLUDE <P16F877A.INC>
  2. COUNT   EQU 0Ch
  3. COUNT_2     EQU 1Ch
  4. ORG 0  
  5.                    
  6. movlw 0xF0
  7.  
  8. movwf PORTB
  9. bsf STATUS,5
  10. movlw 0
  11. movwf TRISB
  12. bcf STATUS,5
  13. m2
  14. BTFSS PORTB,7
  15. call Flash
  16.  
  17. BTFSS PORTB,6
  18. call Flash2
  19.  
  20. BTFSS PORTB,5
  21. call Flash2
  22.  
  23. BTFSS PORTB,4
  24. call Flash
  25.  
  26. GOTO m2
  27.  
  28.  
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30. Flash
  31. bsf STATUS,5
  32.  
  33. clrf TRISD
  34. bcf STATUS,5
  35. movlw 0x01
  36. movwf PORTD
  37. LOOPFL
  38. rlf PORTD, d
  39. call DELAY3
  40. BTFSS PORTD, 7
  41. goto LOOPFL
  42. movlw 0x00
  43. movwf PORTD
  44. call DELAY3
  45.  
  46. RETURN
  47.  
  48.  
  49. DELAY3  MOVLW 0          
  50.         MOVWF COUNT
  51.        
  52. LOOP      
  53.         MOVLW  0        
  54.         MOVWF COUNT_2
  55. LOOPP
  56.         nop
  57.         nop
  58.         nop
  59.  
  60.  DECFsz COUNT_2,F
  61.         GOTO LOOPP
  62.  DECFSZ COUNT,F
  63.         GOTO LOOP
  64.   RETURN
  65.  
  66. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  67. Flash2
  68. bsf STATUS,5
  69.  
  70. clrf TRISD
  71. bcf STATUS,5
  72. movlw 0x01
  73. movwf PORTD
  74. LOOPFL2
  75. rlf PORTD, d
  76. call DELAY4
  77. BTFSS PORTD, 7
  78. goto LOOPFL2
  79. movlw 0x00
  80. movwf PORTD
  81. call DELAY4
  82.  
  83. RETURN
  84.  
  85.  
  86. DELAY4  MOVLW 200          
  87.         MOVWF COUNT
  88.        
  89. LOOPT      
  90.         MOVLW  150        
  91.         MOVWF COUNT_2
  92. LOOPPT
  93.         nop
  94.         nop
  95.         nop
  96.  
  97.  DECFsz COUNT_2,F
  98.         GOTO LOOPPT
  99.  DECFSZ COUNT,F
  100.         GOTO LOOPT
  101.   RETURN
  102. ;;;;;;;;;;;;;;;;;;;;;;;;;
  103. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement