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