Yup...
But that's a very interesting point.
In the 4620 program it does turn off the timer at that point.
But the 877A program does not.
And you can even see the difference in the simulation.
The 4620 always has the same values for CCPR1L:H and period (+1?), but the 877A doesn't.
4620
Code:
T1CON.0=1
Capture = 0
CaptureLoop:
If Capture = 0 then
Goto CaptureLoop
endif
T1Con.0=0
period.LowByte=CCPR1L
period.HighByte=CCPR1H
RPM = 10000
877A
Code:
T1CON.0 = 1 ' Start the Timer
capture = 0 ' Reset the capture flag
CaptureLoop:
IF capture = 0 Then
goto CaptureLoop ' Wait here until captured
endif
; nada
period.lowbyte = CCPR1L ' Store the captured value in
period.highbyte = CCPR1H ' period variable
RPM = 10000
And when a Timer is turned off, it retains the last value in the TMR?L:H registers.
<br>
Bookmarks