8 Replies Latest reply on Jan 6, 2013 10:19 PM by user_14586677

    Measuring time with counter on CY8C24123A

    simon.kristensen

       Hello

         

      So I try to count time using a CY8C24123A
      I use an 8bit counter running on 32 khz and make it interrupt at terminal count. Every time it interrupts, I add 1 to an integer, 1 is equal to 0,008s or 8ms.

         

      32000/256=125
      1s/125=0,008

      But if I try and count 60 seconds, it will count 63 seconds. And the longer I count, the more wrong it will get. 90 will be 94,5

      I cant figure out where I can have a problem. The counter is running sync with the processor.