
2004 Microchip Technology Inc. DS00900A-page 7
AN900
FIGURE 7: INTERRUPT SERVICE ROUTINE
Timer0 overflow?
ADC ready?
Calculate New
Target Velocity
ISR High Priority
ISR Low Priority
Yes
No
Read Sine Values
from Table*
Calculate New
Update Table Offsets*
Direction change?
Calculate Timer0
Reload Value*
Swap Phase 1 and
Phase 2 Offsets*
Yes
No
Yes
No
Return from
Interrupt
Duty Cycle based on
Target Speed and
*In actual implementation, a flag is set and operation is performed within the main loop.
Comentarios a estos manuales