Correct me if i'm wrong, but I should be able to set the value of TMR0L and TMR0H to whatever I like yes?
If I do this as a test:
Code:
DEFINE OSC 48
T0CON=%10010110
TMR0L=0
TMR0H=0
pause 200
result.LowByte=TMR0L
result.HighByte=TMR0H
The result varies every time i do it. As if reseting TMR0L and TMR0H is doing nothing.
However if I do this:
Code:
DEFINE OSC 48
T0CON=%10010110
result1.LowByte=TMR0L
result1.HighByte=TMR0H
pause 200
result2.LowByte=TMR0L
result2.HighByte=TMR0H
result=result2-result1
The result is correct every time.
Does anyone know why?
Bookmarks