Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ORG 0
- LCALL init_timer
- SJMP $
- ORG 0Bh
- MOV TH0, #60
- MOV TL0, #150
- CPL P1.4
- RETI
- init_timer:
- CLR TR0
- MOV TMOD, #01
- MOV TH0, #60
- MOV TL0, #150
- CLR TF0
- SETB ET0
- SETB EA
- SETB TR0
- RET
- ;----------------------------------------
- test_delay:
- CLR P1.5
- MOV R7, #20
- ;LCALL odmierz_x50ms_int
- SETB P1.5
- MOV R7, #10
- ;LCALL odmierz_x50ms_int
- SJMP test_delay
- ;----------------------------------------
- ; Opoznienie R7 x 50 ms
- ;----------------------------------------
- odmierz_x50ms:
- CLR TR0
- MOV TMOD, #01
- odmierz_x50ms_petla:
- MOV TH0, #60
- MOV TL0, #150
- CLR TF0
- SETB TR0
- JNB TF0, $
- DJNZ R7, odmierz_x50ms_petla
- RET
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement