Hello Moses,
Thanks for your time.
First of all, I'm going to answer your questions:
- I'm using a 4000Hz period (TBPRD=18750, up-down mode, Prescale=1)
- Yes, in my original application (it's composed by the skeleton: hwi, tasks, clocks, swi, etc) the latency moves from 280 to 6000 cycles. The latency moves from 280 to 1300 normally and it arrives to 6000 cycles when the event occurs.
- In the simple test application I sent you the measure is constant. But when the event occurs it passes from 280 to 750 cycles.
- The event occurs consistently in both projects, but it seems worse in the original application.
And finally, I think we have detected the problem. I proceed to explain you what we have seen.
First of all in the simple project. We've disabled the system bios clock (Unchecked Enable Clock Manager) [1]. The event disappeared.
After that we have created a 1ms interrupt with the Timer 0. We configured it with 150000 ticks period [2]. The event appeared again.
Then we have configured the interrupt correctly, using 14999 ticks[3]. The event disappear again.
So, it seems the problem occurs when two interrupts arrive at the same time to the dispatcher. When I configured [2] the behavior is exactly the same that when I configured [1]. In both cases timer interrupt overlaps PWM interrupt periodically. When I configured [3] the interrupts never overlap.
More things, I've tested the "solution" in the complex program, the original one. In that way, I've configured the application clock as Application calls clock_sys. After that I've made my own timer to clocking the system with the timer 0. If I configure with 150000 ticks the behavior is the same explained before. If I configure 149999 ticks then the maximal interrupt latency becomes constant to 1300 cycles.
So, my main question is: how SysBios manage two simultaneous interrupts?
I've been testing the masking options, without any result. I think the critical interrupt must be configured as MaskingOption_ALL and the other ones as MaskingOption_SELF but I can't see difference with other configurations.
Thanks in advance.
Regards