Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I have TMR0 which is 10 ms timer
I wish to use GP register as a 1 second timer using TMR0 timer of 10ms
I tried the following code but didnt get the result
btfsc INTCON,2
decf count2,0 // count2 is 100 in decimal
btfsc STATUS,Z
'''''''''''remaining code
after each time the TMR0 overflows i decremented count2 and this will repeat 100 times which should have given 1 second
Please let me know your ideas on this
Delay
clrf TMR0 ;start TMR0 counting at 0
bcf INTCON,T0IF ;clear TMR0 interrupt flag
movlw d'100' ;set the timer interrupt counter
movwf count2 ;to decimal 100
W8 btfsc INTCON,T0IF ;check TMR0 interrupt flag
goto W8 ;branch if set
bcf INTCON,T0IF ;clear TMR0 interrupt flag
decfsz count2,F ;decriment interrupt counter by 1
goto W8 ;branch if zero
return
btfsc INTCON,2
decf count2,0 // count2 is 100 in decimal
btfsc STATUS,Z