Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pic 16 1.45 KB | None | 0 0
  1.     #include p18f87k22.inc
  2. init:  
  3.     bcf INTCON2, RBPU ;rezystory ustawiane indywidualnie
  4.     clrf PORTE
  5.     clrf PORTA
  6.     clrf PORTB
  7.     bsf TRISB, RB0 ; rezystor podciagajacy dla przycisku - PB0 jako wejscie
  8.    
  9.     bcf TRISB, RB5  ;gaszenie nieuzywanych LED
  10.     bcf TRISB, RB4
  11.     bcf PORTB, RB5
  12.     bcf PORTB, RB4
  13.  
  14.     bcf TRISE, RE4 ; porte re7 wyjscie
  15.     bcf TRISE, RE5 ;
  16.     bcf TRISE, RE6 ;
  17.     bcf TRISE, RE7 ;
  18.     bcf TRISA, RA5 ;
  19.     bcf TRISB, RB4 ;
  20.     bcf TRISB, RB5 ;
  21.  
  22. initwcis:
  23.     btfsc PORTB,RB0
  24.     goto et
  25.     goto initwcis
  26.  
  27. et: btfss PORTB, RB0
  28.     goto et1
  29.     goto et
  30.    
  31. et1:
  32.     btg PORTE,RE4
  33.  
  34. et1wcis:
  35.     btfsc PORTB,RB0
  36.     goto et11
  37.     goto et1wcis
  38.  
  39. et11:
  40.     btfss PORTB, RB0
  41.     goto et2
  42.     goto et11
  43.  
  44. et2:
  45.     btg PORTE,RE5
  46.  
  47. et2wcis:
  48.     btfsc PORTB,RB0
  49.     goto et22
  50.     goto et2wcis
  51.  
  52. et22:
  53.     btfss PORTB, RB0
  54.     goto et3
  55.     goto et22
  56.  
  57. et3:
  58.     btg PORTE,RE6
  59.  
  60. et3wcis:
  61.     btfsc PORTB,RB0
  62.     goto et33
  63.     goto et3wcis
  64.  
  65. et33:
  66.     btfss PORTB, RB0
  67.     goto et4
  68.     goto et33
  69.  
  70. et4:
  71.     btg PORTE,RE7
  72.  
  73. et4wcis:
  74.     btfsc PORTB,RB0
  75.     goto et44
  76.     goto et4wcis
  77.  
  78. et44:
  79.     btfss PORTB, RB0
  80.     goto et5
  81.     goto et44
  82.  
  83. et5:
  84.     btg PORTA,RA5
  85.  
  86. et5wcis:
  87.     btfsc PORTB,RB0
  88.     goto et55
  89.     goto et5wcis
  90.  
  91. et55:
  92.     btfss PORTB, RB0
  93.     goto et6
  94.     goto et55
  95.  
  96. et6:
  97.     btg PORTB,RB4
  98.  
  99. et6wcis:
  100.     btfsc PORTB,RB0
  101.     goto et66
  102.     goto et6wcis
  103.  
  104. et66:
  105.     btfss PORTB, RB0
  106.     goto et7
  107.     goto et66
  108.  
  109. et7:
  110.     btg PORTB,RB5
  111.  
  112. et7wcis:
  113.     btfsc PORTB,RB0
  114.     goto et77
  115.     goto et7wcis
  116.  
  117. et77:
  118.     btfss PORTB, RB0
  119.     goto init
  120.     goto et77
  121.  
  122.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement