problem in starting Timer1 in MSP430

Thread Starter

ep.hobbyiest

Joined Aug 26, 2014
201
I m using msp430g2553 launch pad and configuring timer. but facing problem.
Here is my code
Code:
#include <msp430g2553.h>


void main(void) {
    WDTCTL = WDTPW + WDTHOLD;    // disable watchdog

    P1OUT = 0;
    P1DIR |= 0x01;    //led

    TACCR0 = 10000;   
    TACCTL0 = CCIE;        // Enable interrupts for CCR0.
    TACTL = TASSEL_2 + ID_3 + MC_1 + TACLR;  // SMCLK, div 8, up mode,
                                            // clear timer

    _enable_interrupt();

    for(;;) {    // Do nothing while waiting for interrupts.  This would be an
    }            // an ideal place to use low power modes!
} // main


/*  Interrupt Service Routines  */
#pragma vector = TIMERA0_VECTOR
__interrupt void CCR0_ISR(void) {
        P1OUT ^= 0x01;
    }
// CCR0_ISR
 

tindel

Joined Sep 16, 2012
939
_enable_interrupt(); doesn't seem right to me... I think you have to enable the interrupt register for Timer A0 instead.

it does look like _enable_interrupt() is a valid function call from intrinsic.h, but I can't find the code that describes the function. Are you getting a linker error or what? I would bet you compile just fine and your linker is failing, No?
 
Top