Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #include <p16f1517>
  2. __CONFIG _CONFIG1 ,_FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF &_CLKOUTEN_OFF
  3. __CONFIG _CONFIG2 , _WRT_OFF & _VCAPEN_OFF & _LVP_OFF
  4.  
  5. #define LE_L PORTC,4
  6. #define LE_H PORTC,5
  7. #define BL PORTC,2
  8.  
  9. ORG 0x00
  10. goto ustawienia
  11. ORG 0x04
  12. goto przerwanie
  13. ustawienia
  14.  
  15. C1 equ 0x64
  16. C2 equ 0x63
  17. C3 equ 0x62
  18. C4 equ 0x61
  19. BANKSEL PORTA
  20. clrf PORTB
  21. clrf PORTC
  22. clrf PORTD
  23. BANKSEL TRISA
  24. clrf TRISA
  25. movlw 0x05
  26. movwf TRISB
  27. clrf TRISD
  28. movlw 0x74
  29. movwf TRISC
  30. BANKSEL ANSELA
  31. clrf ANSELB
  32. clrf ANSELC
  33. clrf ANSELD
  34. BANKSEL LATA
  35. clrf LATB
  36. clrf LATC
  37. clrf LATD
  38.  
  39.  
  40. MAIN
  41.  
  42. przerwanie
  43. BTFSC INTCON,INTF ;bo to ma reagowac na przerwanie od przycisku
  44. goto OB_OK
  45. BTFSC INTCON,TMR0IF ;bo to ma reagowac na przerwanie od Timer0
  46. goto OB_TMR0
  47.  
  48.  
  49. PRZYCISKI
  50. BTFSS PORTB,0
  51. GOTO DOWN
  52. GOTO OK
  53. DOWN
  54. BTFSS PORTB,2
  55. GOTO PRZYCISKI
  56. GOTO ZERO
  57. ZERO
  58. CLRF C1
  59. CLRF C2
  60. CLRF C3
  61. CLRF C4
  62. OK
  63. INCF C1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement