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.

[参考译文] CCS/MSP430F5438A:如何禁用计时器中断

Guru**** 2553920 points
Other Parts Discussed in Thread: MSP430F5438A

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/616459/ccs-msp430f5438a-how-to-disable-the-timer-interrupt

部件号:MSP430F5438A

工具/软件:Code Composer Studio

你(们)好

我正在尝试使用MSP430F5438A中的计时器创建1毫秒的延迟

它在ISR_TRAP处理程序中被击中

请建议所需的任何代码更改

这是我的代码

INT MAIN ()


   TIMEREND=0;
   
  
  timer_delay();
   while (TIMEREND!= 1);
 
    SPI_READ_WRITE ();  
  

}

timer_delay()

 
    TA0CCR0 = 1600-1;
    TA0CCTL0 = CCIE;                         // CCR0中断已启用
    TA0CTL = tassel_2 + MC_1;        // SMCLK,升级模式
        __bis_sr_register( GIE);      //输入LPM0,启用中断
 
 
}

//计时器A0中断服务例程
#if defined(__TI_Compiler_version__)|| defined(__IAR_SYSTEMS _ICC__)
#pragma vector=TIMER0_A0_vector
__interrupt void TIMER0_A0_ISR(void)
#Elif已定义(__GMNU__)
void __attribute__((interrupt (Timer1_A0_vector))) Timer1_A0_ISR (void)
#否则
错误编译器不受支持!
#endif

   TIMEEND = 1;
 TA0CTL |= MC_0;  
}

在调试模式下,当它进入 SPI_READ_WRITE ()时,它进入陷阱处理程序并被击中。 我不知道原因是什么

我已检查SR Register (SR注册),CPUOFF (CPUOFF)设置为1。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您正在使用不同编译器的不同向量。

    您不能使用||来清除某位。