Facebook
From adam, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 224
  1. Ddra = &B11111111                                           'ustawianie wyjscia na porcie A
  2. Porta = &B00000000                                          'wylaczenie wszystkich diod
  3. Ddrb = &B1011                                               'restet wl = 1 , t1,t2 = 0
  4. Portb = &B1011
  5. Sreg.7 = 1                                                  'Ustawienie przerwania'
  6. Mcucr.0 = 0                                                 ''
  7. Mcucr.1 = 1
  8. Gimsk.6 = 1                                                 ''
  9.  
  10. Dim A As Byte                                               'utworzenie zmiennych'
  11. Dim B As Byte
  12. Dim C As Word
  13.  
  14. On Int0 Mru
  15.  
  16. Tccr1b.0 = 0
  17. Tccr1b.1 = 0
  18. Tccr1b.2 = 1
  19. Do
  20.  
  21. Loop
  22.  
  23.  
  24. End
  25. Mru:
  26. A = Tcnt1l
  27. B = Tcnt1h
  28. C = B
  29. Tcnt1l = 0
  30. Tcnt1h = 0
  31. Shift C , Left , 8
  32. C = A + C
  33. Porta = B                                                   'zmien stan'
  34. Return