I'm having an issue dealing propably with missed PLM interrupts on 21369.
For my application, I need to reproduce a PLM-Sequence at low speed precisely. The switching-rate (=frequency of updating the pwm via ISR) is: f_sys=100MHZ devided with the maximum devider of 0xefff, gives f_switch~ 2.54kHz. Should not make too many dificulties.
This works flawlessly for 50-80 cycles, then the ISR does not update the PWM-counter for ~10cycles before it returns to another 50-80cyles of normal operation (and so on). If Optimization is set to max, 2-3 cycles are missed every ~30cycles.
I assumed, there is another (higher) interrupt with higher priority as source for the missed interrupts, so I stripped down my programm to:
- empty main loop
- disable all peripherals except SDRAM
- running from flash to avoid interference from the debugger
- loading the PWM-Values from a circular buffered array from pm
The problem is persistend. The statistical profiling gives ~9% execution time for the ISR und ~87% for the interrupt-controller, which sounds a bit weird to me, but may be OK (empty main loop).
Init and ISR are written in C. I am using one of the Hardware-PWM-Units, not a general purpose timer. Hardware is rev 3A on EZlite.
Any hint is appriciated.