I need to poll the TMR0 in 16F54 to generate 32768uS.
Is this below code will work very accurate?
Note: process routine cycles vary on every TMR0 overflows.
Is this below code will work very accurate?
Note: process routine cycles vary on every TMR0 overflows.
Code:
;PS=1:128,TMR0=256
;XT=4Mhz
T0_Loop movf TMR0,W ;read TMR0
btfss STATUS,Z ;is TMR0 overflowed?
goto T0_Loop ;no,then loop
;yes,overflowed
Process ---- ;
---- ;
goto T0_Loop