Event Update Interrupt Call delayed
Folks
I have set TIM2 in center-aligned PWM mode as well as a timebase ISR in which I just toggle the LED (for inspection and better understanding of the operation, otherwise to be replaced by an ADC activation, etc.). Thus, each edge of the LED (pin) voltage waveform represents one ISR call or one overflow/underflow event update. The scheme works fine except that the edges of the LED voltage (i.e., interrupt calls) are a bit delayed with respect to the centers of the PWM output pulses (about 2 us delayed), on a 20kHz PWM output train. This delay would be problematic at PWM duty cycles close to zero or close to unity since it would result in two ISR calls during the interval when the PWM pulse is high or low. Any ideas what is causing this large delay? I expected the ISR calls to exactly (within nanoseconds) coincide the centers of the PWM pulses (as the event updates take place at those instants). TIM2 is clocked at 72MHz.
Amir