Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ORG 0           ;wektor zerowania
  2. JMP main        ;bezwarunkowo skocz poza obszar wektorów przerwań
  3. ORG 000BH       ;wektor przerwania po przepełnieniu timer0
  4. CPL P1.0        ;zmień stan P1.0 na przeciwny
  5. RETI            ;powrót z przerwania
  6. ORG 0030H       ;początek programu głównego
  7.  
  8. main:
  9. CLR P0.7        ;włączenie oscyloskopu
  10. MOV TMOD, #02H  ;ustaw dla timer0 tryb 2
  11. MOV TL0, #-5    ;ustaw TL0 na przepełnienie po 5us
  12. MOV TH0, #-5    ;ustaw TH0 na przepełnienie po 5us
  13. SETB TR0        ;uruchom timer0
  14. SETB EA         ;globalnie zezwól na przerwania
  15. SETB ET0        ;zezwól na przerwanie po przepełnieniu timer0
  16. JMP $           ;pętla pusta - czekaj na przerwania
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement