This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

timer accuracy

hi support team,

customer want to setup a timer with 800 us and then 1200 us and then repeatedly without any delay.

for now i use timer to set channel 1 with 800 us cc value, in compare handler,  stop it and clear the counter and set cc value to 1200 us and resume it, but found out that there will be some delay from 8 us to 46 us randomly.

so we can see that start timer will have delay to maker timer accurately when my requirement goes to 100 us level.

so my question is as the topic, i want have 800 us interrupt handler and 1200 us  interrupt handler very accurately.

Regards,

William。

  • Why not just set 400us repeated wakeup handler, then simply have a counter incrementing in the handler, such that every %2 and %3 times the handler executes you run the 800us or 1200us?

    Then you don't need to dynamically adjust or update the CC register or start/stop timers, which I assume is the problem you are experiencing here.

    Best regards,
    Kenneth

Related