Of course I had to open a can of worms.
This thread goes into detail how Darrel's Elapsed timer is off by 1:
https://www.picbasic.co.uk/forum/sho...789#post132789The value he used for each of the Oscillator rates is (1) less than it should be.
The reason is that he calculated the Timer1 counter overflow value as 65535 instead of using 65536.
Timer1 is a 16bit counter from 0 to 65535.
It takes 65536 counts to overflow (Wrap back to 0) and trigger the Timer1 interrupt.
This means that his 10ms interrupt will actually run longer by (1) instruction than it should.
Note to self: TimerCalc is in MultiCalc by Mr. E; (Timer Helper).![]()
Bookmarks