|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Regularity of RepeatingTimer interrupts?
How accurate can I count on the trigger timing of ISRs registered with RegisterRepeatingTimer() to be?
I have the idea of using a repeating timer to do regular velocity calculations on the two quad encoders attached to my gear boxes. Basically the ISR would read the encoder counts, subtract the previous counts from each to get the differences, and divide by the repeating timer interval (most likely 256ms, so I can divide using bit shifting). The resulting velocities would be stored in global variables to be accessed by my PID code running in the "default" loop. Will this work? |
|
#2
|
|||
|
|||
|
Re: Regularity of RepeatingTimer interrupts?
The code resets the timer value as the first thing when the interrupt occurs, so it should stay pretty accurate. I would think it would be close enough for the calculations that you need to do.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple Interrupts | windell747 | Programming | 13 | 03-02-2008 03:52 |
| Interrupts | JSonntag | Programming | 1 | 14-01-2006 12:43 |
| Using Interrupts | Leav | Programming | 1 | 14-02-2005 07:22 |
| Interrupts | CyberWolf_22 | Control System | 3 | 12-01-2004 21:46 |