• PicŪ Basic


  • Correcting timing errors

    I got this one from Olivier

    When writing a timer routine it is often very difficult to get accuracy. If timing correction is attempted at the lowest level in say the OSC freq selection or the interrupt routine reload value, even though the error may be very small it can accumulate over time to become quite large. A 1 us error every 100hz will add up to 8.64 seconds per day.

    A way to reduce those errors is to time the code over a reasonable period i.e. 24 hours. Then at the appropriate section in the routine, you can compensate for the measured error by adding or subtracting in the necessary correction factor.

    Even crude loop counters can be made pretty accurate over extended periods.


    contributed by Timothy Box.
  • Recent Activity

    towlerg-21522

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    towlerg Today, 15:38 Go to last post