-
Enhancement
-
Resolution: Implemented
-
Low
-
TI Device Drivers
-
TIDRIVERS-6038
-
TIDRIVERS_7_20_00
-
TIDRIVERS_7_20_00
-
It has been discovered that the TARTGET interrupt in the LGPT peripheral can occur multiple times in a back-to-back fashion. This can occur when both the counter prescaler of the LGPT is configured with a high value, and the LGPTimerLPF timer params.intPhaseLate is configured to False.
The reason for this is that the TARGET interrupt will be triggered as long as the counter value equals the counter target value. It's not the change in the counter that triggers the interrupt but rather the state of the counter. Can be compared to edge triggering versus level triggering.
When the TARGET interrupt is enabled and the counter reaches the configured counter target, the interrupt will occur either immediately when the counter target is reached or one counter clock cycle after the counter target is reached. These two options is controlled by the LGPTimerLPF3 boolean parameter called "intPhaseLate".
If it triggers immediately (which currently is the default), the interrupt service routine will clear the interrupt status, but if this happens before the counter is changed, a new interrupt will be triggered immediately once more.
The counter will hold the target value for a time equal to one cycle of the counter clock, so the higher the prescaler value is, the longer the counter will hold the target value.
The above behavior is valid for both the TARGET and the ZERO interrupts.
Due to the likelihood of getting back-to-back interrupts, it was decided, that the default value of the params.intPhaseLate should be changed from False to True.
The relationship between params.intPhaseLate and params.prescalerDiv will also be documented in Doxygen.