Part Number: MSP430FR6972
Hi,sir
I want to restart a new timing in the running timer at continous mode. For example, I set timer B0.2 500ms timing , I want to stop it and restart a 20ms timing when timer B0.2 is running on the way to 500ms timing . how could I realize the function? I try to do it as following :
//timing 23.5ms
TB0CCTL0 &= ~CCIE;
TB0CCR0 = 2950;
//timing 500ms
TB0CCTL2 &= ~CCIE;
TB0CCR2 = 62500;
//smclk continuous mode 125kHz
TB0EX0 = TAIDEX_7;
TB0CTL = TBSSEL__SMCLK | MC__CONTINUOUS| ID__8;
//TB0.2 interrupt
case TB0IV_TB0CCR2:
TB0CCR2 += 62500;
//..
//..execute some code
//..
if(temp1%2)
{
//I want to stop running 500ms timing,start a new B0.2 timing to 20ms
TB0CCTL2 &= ~CCIE;
TB0CCR2 = 2500;
TB0CCTL2 |= CCIE;
}
break;
I found this is wrong ,It couldn't to restart a new 20ms timing .please help me solve the problem ,I will appreciate you very much.