Hi there!
I'm using a SmartRFCC1110-868 kit and IAR to evaluate the CC1110 SoC.
I'm having problems with some interrupt flags, specifically I can't clear them and the CPU vectors to the ISR non-stop.
Here are my code snippets. The bitfields are made by me because I didn't like IAR's definitions in the I/O file.
I have checked the assember listing and the code does try to clear the bits I need, but they stay set.
I have tried various approaches to look on the subject, breaking inside the ISR, halting in random locations, etc.
Once the CPU has vectored to the ISR, the flags stay set.
Thanks!
Edit: I should mention that I am talking about IRCON.T3IF and TIMIF.T3OVFIF, shown on the ISR function.
///////////////////////////////////////////////////////////////////////////////
/*!Declarations
*/
///////////////////////////////////////////////////////////////////////////////
static volatile unsigned char st_tick_timer;
///////////////////////////////////////////////////////////////////////////////
/*!void SoftTimerInit (void)
/ @Tick Timer initialization.
/ @Tickspeed 1:128, T3 div 1:4, 1ms should be ~51 T3 periods.
/ @1msec @ 26MHz
*/
///////////////////////////////////////////////////////////////////////////////
void
SoftTimerInit (void)
{
T3CC0 = 51;
T3CTL.DIV = 2;
T3CTL.MODE = 2;
TIMIF.T3OVFIF = 0;
T3CTL.OVFIM = 1;
IEN1.T3IE = 1;
IEN0.EA = 1;
T3CTL.START = 1;
}
///////////////////////////////////////////////////////////////////////////////
/*!__interrupt static void TickTimerIsr (void)
/ @ISR every 1 msec.
*/
///////////////////////////////////////////////////////////////////////////////
#pragma vector = T3_VECTOR
__interrupt static void
TickTimerIsr (void)
{
IRCON.T3IF = 0;
st_tick_timer ++;
TIMIF.T3OVFIF = 0;
}
///////////////////////////////////////////////////////////////////////////////