This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5438A: 定时器A Timer1CCR1无法正常开启定时

Part Number: MSP430F5438A

程序初始化时,单对Timer1CCR1进行定时初始化,并且打开定时器,但是定时器没有进入中断,装载一下Timer1CCR0,Timer1CCR1就能正常工作。程序如下:

// TA1CTL=TASSEL_2+TACLR; 

//TA1CCR0=45000;  

TA1CTL=TASSEL_2+TACLR; 

TA1CCR1=45000; //配置定时值

TA1CCTL1=CCIE; //Timer1 CCR1中断使能

TA1CTL |= MC_1; //UP Mode

_BIS_SR(GIE);

__interrupt void Timer1_A1_ISR(void)
{
switch(__even_in_range(TA1IV,14))
{

case 0:break;

case 2:

{

......

}break;

  • 有参考例程吗?

    Timer1CCR1就能正常工作。

    这个是通过什么来判断的?因为CCR0和CCR1的计数值都相等。

    另外没有在TA1CTL中使能TA1中断,起码帖出来的代码中是这样的。