I'd be willing to bet that TMR3 is rolling over so fast, that you're not seeing the actual value; you're actually seeing just the lower 16 bits of that value. If TMR3 had 32 bits, you might see the value increasing past 65535.
The difference between using pause 50 and pause 500 might be just enough difference in the number of instructions to give you that difference that you're seeing.
Try this and see how fast it actually rolls over:
I added another counter that'll pick up the number of times that TMR3 rolled over and a counter that'll show you how fast the loop goes thru (which really doesn't have anything to do with how fast TMR3 counts other than the oscillator's speed).
DEFINE RESET_ORG 800h
DEFINE OSC 32
DEFINE LCD_LINES 4
DEFINE LCD_DREG PORTD
DEFINE LCD_RSREG PORTC
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 1
OSCCON = %11110000 '8 mhz, internal osc
OSCTUNE = %11000000 '4x PLL enabled
T1CON.7 = 1 '16 bits read/write
T1CON.6 = 0 'clock from internal osc
T1CON.5 = 1 '1:8 prescale
T1CON.4 = 1 '1:8 prescale
T1CON.3 = 0 'osc shut off
T1CON.2 = 1
T1CON.1 = 0 'Internal clock
T1CON.0 = 1 'enabled
T3CON.7 = 1 '16 bits read/write
T3CON.5 = 1 '1:8 prescale
T3CON.4 = 1 '1:8 prescale
T3CON.1 = 1 'clock from timer1
T3CON.0 = 1 'enabled
myTMR var word
oldmyTMR var word
myTMR = 0
rollover var word
timesthru var word
TMR3H = 0
TMR3L = 0
lcdout $fe , 1
start:
myTMR.byte1 = tmr3h
myTMR.byte0 = tmr3l
if oldmyTMR > myTMR then rollover = rollover + 1 'TMR3 rolled over back to zero because the old value is greater than the new value
LCDout $FE,$80, "timer:" , DEC myTMR , " "
lcdout $fe , $c0, "rollover:",DEC rollover, " "
lcdout $fe , $94, "times thru:", DEC timesthru, " "
oldmyTMR = myTMR
timesthru = timesthru + 1
goto start
Bookmarks