This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2430 timer1 capture mode

Other Parts Discussed in Thread: CC2430

Hi,

I try to use timer1 capture mode.

But it looks like no work. The interrupt never happen.

Maybe I lose some step. Please advice. Thanks.

#include "iocc2430.h"
#define st(x)      do { x } while (__LINE__ == -1)
#define HAL_ENABLE_INTERRUPTS()         st( EA = 1; )
#define HAL_DISABLE_INTERRUPTS()        st( EA = 0; )
#define HAL_INTERRUPTS_ARE_ENABLED()    (EA)
#define _PRAGMA(x) _Pragma(#x)
#define HAL_ISR_FUNC_DECLARATION(f,v)   _PRAGMA(vector=v) __near_func __interrupt void f(void)
#define HAL_ISR_FUNC_PROTOTYPE(f,v)     _PRAGMA(vector=v) __near_func __interrupt void f(void)
#define HAL_ISR_FUNCTION(f,v)           HAL_ISR_FUNC_PROTOTYPE(f,v); HAL_ISR_FUNC_DECLARATION(f,v)
int main(void)
{

  HAL_ENABLE_INTERRUPTS() ;
  T1CCTL1 = 0;
  PERCFG |= 0x40;//set alternative 2
  P1SEL |= 0x02; //P1_1 to peripheral
  T1CTL |= 0x08;

  T1CCTL1 |= 0x7A; //capture in falling edge

IEN1 |= 0x02;
  while(1){
  }
}
HAL_ISR_FUNCTION( israbcd, T1_VECTOR )
{
 //do something
}