Tool/software: TI-RTOS
Hello,
I am trying to register two interrupt sources for one GPTimer of the CC2640.
First source: Positive edges on an defined pin (Therefore I am using the edge time up mode)
Second source: Timeout of the timer (reaching the preset load value with GPTimerCC26XX_setLoadValue(handle, 0xFFFFFF) ) in periodic up mode
Independently from each other both sources trigger an interrupt, but if I try to combine them I do not get my desired result.
Maybe a few questions ahead:
1. Is it possible to register more than one interrupt for one timer?
2. Is it even possible to use Timeout as an interrupt source in edge time up mode?
As a first try i used two 16 Bit Timers, where one works in edge time up mode (Timer A) and the other in periodic up mode (Timer B). The callback function of Timer A should reset Timer B, so that this one would never trigger an interrupt. With this implementation both timers are running correctly, but Timer B is not reset, which can be seen, because ruffly every 350 ms it triggers an interrupt, even though Timer A callback function is called several times in between. My try to reset Timer B in the callback function of Timer A looks like that:
GPTimerCC26XX_stop(hTimerB); GPTimerCC26XX_start(hTimerB);
This was the approach using two timers, but more desirable would be a solution just using one timer. Therefore i worked with
GPTimerCC26XX_enableInterrupt and GPTimerCC26XX_registerInterrupt functions to add two interrupt sources to one timer. My tries were unsuccessfull though.
So if anybody could provide advice or examples on one of my approaches to register two interrupt sources or successfully reset one timer i would be massively grateful.
If there are even better ways i would be glad to hear them.
Kind regards