hay ,
i want my timer to have a 500ms interrupt on overflow interval
fosc is typically 4 MHz so fosc/4=1MHz
desired scale is 500000
max scale by timer 256*256
if we say 4* 125=500 then i need 125 interrupts? each after 4 seconds? 32 prescaling?
if so i will intialize thetimer0 to 131 , but if i want to count backward should it be 125 or 124?
this is my hardware timer code
bcf STATUS,RP1
bsf STATUS,RP0
movlw B'11010100
movwf OPTION
bcf STATUS,RP0
movlw D'131'
movwf TMRO
bcf INTCON,T0IF
bsf INTCON,T0IE
bsf INTCON,GIE
return
and my software timer
five00Ms
movlw 124
movwf BLNKCNT
wait500
btfss BLNKCNT,7
goto wait500
return
my question why 124 not 125?
plz HELP!