;*****************************************************************
;延时10uS
;*****************************************************************
time10us: mov r5,#05h ;11us
djnz r5,$
ret
;*****************************************************************
;延时50uS
;*****************************************************************
time50us: mov r5,#19h ;51us
djnz r5,$
ret
;*****************************************************************
;延时100uS
;*****************************************************************
time100us: mov r5,#31h ;99.6us
djnz r5,$
ret
;*****************************************************************
;延时200uS
;*****************************************************************
time200us: mov r5,#64h ;201us
djnz r5,$
ret
;*****************************************************************
;延时250uS
;*****************************************************************
time250us: mov r5,#7ch ;249.6us
djnz r5,$
ret
;*****************************************************************
;延时350uS
;*****************************************************************
time350us: mov r5,#0afh ;351us
time350us_1: djnz r5,time350us_1
ret
;*****************************************************************
;延时500uS
;*****************************************************************
time500us: mov r5,#0fah ;501us
time500us_1: djnz r5,time500us_1
ret
;*****************************************************************
;延时1mS
;*****************************************************************
time1ms: mov r5,#0fah ;1001us
time1ms_1: nop
nop
djnz r5,time1ms_1
ret
;*****************************************************************
;延时2.5mS
;*****************************************************************
time2_5ms: mov r5,#05h ;2.496ms
time2_5ms_1: mov r6,#0f8h ;497us
djnz r6,$
djnz r5,time2_5ms_1
ret
;*****************************************************************
;延时10mS
;*****************************************************************
time10ms: mov r5,#14h ;10.262ms
time10ms_1: mov r6,#0ffh ;511us
djnz r6,$
djnz r5,time10ms_1
ret
;*****************************************************************
;延时50mS
;*****************************************************************
time50ms: mov r5,#63h ;49.996ms
time50ms_1: mov r6,#0fbh ;503us
djnz r6,$
djnz r5,time50ms_1
ret
;*****************************************************************
;延时100mS
;*****************************************************************
time100ms: mov r5,#0c3h ;100.036ms
time100ms_1: mov r6,#0ffh ;511us
djnz r6,$
djnz r5,time100ms_1
ret
;*****************************************************************
;延时200mS
;*****************************************************************
time200ms: mov r5,#02h ;250.351ms
time200ms_1: mov r6,#0f4h ;125.173ms
time200ms_2: mov r7,#0ffh ;511us
djnz r7,$
djnz r6,time200ms_2
djnz r5,time200ms_1
ret
;*****************************************************************
;延时500mS
;*****************************************************************
time500ms: mov r5,#04h ;500.701ms
time500ms_1: mov r6,#0f4h ;125.173ms
time500ms_2: mov r7,#0ffh ;511us
djnz r7,$
djnz r6,time500ms_2
djnz r5,time500ms_1
ret
;*****************************************************************
;延时1S
;*****************************************************************
time1s: mov r5,#08h ;1001.401ms
time1s_1: mov r6,#0f4h ;125.173ms
time1s_2: mov r7,#0ffh ;511us
djnz r7,$
djnz r6,time1s_2
djnz r5,time1s_1
ret