can anybody tell me the timing delay of the 12 microsecond timer. it says that it is a 12 microsecond timer but i have doubt on it.im using a PIC16F873 and using a 4Mhz crystal resonator
;*** 40KHz pulse send ( 0.5 msec )
movlw d'20' ;Send-out pulse count
movwf s_count ;Set count
s_loop
call pulse ;Call pulse send sub
decfsz s_count,f ;End ?
goto s_loop ;No. Continue
;*************** Pulse send-out Process ****************
pulse
movlw b'00100000' ;RC4=ON
movwf PORTC ;Set PORTC register
call t12us ;Call 12usec timer
clrf PORTC ;RC4=OFF
goto $+1
goto $+1
nop
return
;*************** 12 microseconds timer *****************
t12us
goto $+1
goto $+1
goto $+1
goto $+1
nop
return
;*** 40KHz pulse send ( 0.5 msec )
movlw d'20' ;Send-out pulse count
movwf s_count ;Set count
s_loop
call pulse ;Call pulse send sub
decfsz s_count,f ;End ?
goto s_loop ;No. Continue
;*************** Pulse send-out Process ****************
pulse
movlw b'00100000' ;RC4=ON
movwf PORTC ;Set PORTC register
call t12us ;Call 12usec timer
clrf PORTC ;RC4=OFF
goto $+1
goto $+1
nop
return
;*************** 12 microseconds timer *****************
t12us
goto $+1
goto $+1
goto $+1
goto $+1
nop
return