Beenaplaye
Member level 2
Hi guys,
My program doesnt go in the interrupt routine from TimerB or TimerA.
TBR and TAR is counting. The correct flags are set. I realy dont have a clue what's wrong.
My program doesnt go in the interrupt routine from TimerB or TimerA.
Code:
int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
DCOCTL = 7;
BCSCTL1 &= 0x7F;
// set clock on 8.000Mhz clock and put it on MCLK and SMCLK
do
{
unsigned char i = 0xFF;
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (; i > 0; i--); // Time for flag to set
}
while ((IFG1 & OFIFG) == OFIFG); // OSCFault flag still set?
BCSCTL2 |= 0x8A; // MCLK = XT2 (safe) SMCLK = XT2/2
P4SEL |= 0x40;
P4DIR |= 0x40;
TBCCR0 = 200; // geeft een periode van 5khz bij 8 Mhz clock
TBCCR6 = 100; // genereerd negatieve spanning voor scherm
TBCCR1 = 20;
TBCCTL0 = 0; // enable timer interrupt CCIFG0
TBCCTL1 = CCIE; // enable timer interrupt CCIFG0
TBCCTL6 = 0x00C0; // mode 6 pwm op uitgang TB6
TBCTL = 0x02D6; // start timer
TACCTL0 = 0;
TACCR0 = 200;
TACTL = 0x02D6; // start timer
//return 0;
}
#pragma vector=TIMERB0_VECTOR
__interrupt void Timer_B0_ISR(void)
{
P2OUT ^= 0x01;
}
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A0_ISR(void)
{
P2OUT ^= 0x01;
}
TBR and TAR is counting. The correct flags are set. I realy dont have a clue what's wrong.