UINT16 count;
UINT16 max_count;
void triggerTimer(UINT16 pulse_Frequency, UINT16 pulse_count){
count = CLEAR;
max_count = pulse_count;
P1DIR |=BIT0;
P1OUT &= ~BIT0;
TA0CCTL0 = CCIE;
TA0CTL = TASSEL_2 + MC_1 + ID_0 ;
TA0CCR0 = pulse_Frequency;
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A(void)
{
if(count == max_count){
count = CLEAR;
TA0CTL = MC_0 + TACLR;
}
else{
P1OUT ^=BIT0;
count++;
}
}
I wrote above code toggle the pin ,But it is not entering into ISR itself... How to toggle the pin with proper number of counts?