• 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

    teo-16018

    Microsoft security essentials blues

    Thread Starter: shantanu@india

    Hi, A strange thing happened just now.My Windows 7 Micrsoft Sercurity Essentials suddenly gave a warning that prplus.exe(Compiler) is a potential...

    teo Today, 19:23 Go to last post
    barak-1433

    SPI mssp

    Thread Starter: picprotonguy

    Just ordered Digital to Analog IC MCP4822 with SPI interface and immediately opened proton manual. I'm very disappointed, it looks like Proton...

    barak Today, 22:50 Go to last post
    David Barker-251

    UMC bootloader 18F46K22

    Thread Starter: shunt010

    Hi all. I am trying to build a UMC bootloader file for the 18F46K22, and it doesn't appear to work. It returns (in the error log) Error ...

    David Barker Today, 11:20 Go to last post