ISR for timer1 in cc2430

Discussion in 'Embedded Systems and Microcontrollers' started by hazzman, Jan 22, 2008.

  1. hazzman

    Thread Starter Member

    Dec 17, 2007
    13
    0
    Hi people,

    Started doing interrupt programming for my cc2430 project, and i think i've done all the config stuff with the timer1 like shown below and in my ioCC2430.h file the following interrupt vector is associated with Timer1:

    Code ( (Unknown Language)):
    1.  
    2. #define  T1_VECTOR  VECT(9,0x4B )   /*  Timer 1 (16-bit)Capt./Compare/Overfl */
    3.  
    so my main code is like:
    Code ( (Unknown Language)):
    1.  
    2. void main()
    3. {
    4.   T1CTL = 0x0E;   /*  tick_freq/128 -> 32M/128, modulo: 0x0000-> T1CC0*/
    5.   T1CCTL0 = 0x44; /*  set output on compare, compare mode, no capture */
    6.   T1CC0H = 0xEA;
    7.   T1CC0L = 0x60;    /* compare 60,000 for example */
    8.  
    9. OVFIM =1; /* Timer 1 Overflow Interrupt Mask   */
    10. T1IE = 1; /* Timer 1 Interrupt Enable  */
    11. }
    12.  

    SO WHAT'S THE INTERRUPT SERVICE ROUTINE when the interrupt occurs?

    I couldn't find it anywhere!
    p.s. i'm using IAR Workbench
     
  2. nanovate

    Distinguished Member

    May 7, 2007
    665
    1
    You have to write your own ISR.
     
  3. hazzman

    Thread Starter Member

    Dec 17, 2007
    13
    0
    sorry slight mis-understanding here....

    I know i have to write my own ISR here for timer1, what i meant was:

    What format does the ISR have to be?
    e.g. I have seen this somewhere...

    Code ( (Unknown Language)):
    1.  
    2. void timer1_isr(void) interrupt #no.
    3. {
    4.  
    5. }
    6.  
    I've tried this format and it doesn't seem to work.

    What i also meant from the post is that i could not deduce what format the ISR function format had to be from the given header file (io2430.h) for IAR Workbench.
     
  4. nanovate

    Distinguished Member

    May 7, 2007
    665
    1
    This is a compiler specific question:

    IAR uses something like this I believe --> __interrupt void Timer1_ISR (void)

    Double check their documentation though....
     
Loading...