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.

MSP432P401中断返回问题

Other Parts Discussed in Thread: MSPWARE

定时器中断和串口中断服务函数结束时没有继续运行主程序,但是中断服务函数依然可以正常进入,

#include "driverlib.h"

/* Application Defines */
#define TIMER_PERIOD 0x2DC6

/* Timer_A UpMode Configuration Parameter */
const Timer_A_UpModeConfig upConfig =
{
TIMER_A_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
TIMER_A_CLOCKSOURCE_DIVIDER_64, // SMCLK/1 = 3MHz
65535, // 5000 tick period
TIMER_A_TAIE_INTERRUPT_DISABLE, // Disable Timer interrupt
TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE , // Enable CCR0 interrupt
TIMER_A_DO_CLEAR // Clear value
};

vu32 u1=1;

int main(void)
{
Usart1tInit();
SystemClockInit();
led_init();
/* Stop WDT */
MAP_WDT_A_holdTimer();

/* Configuring P1.0 as output */
MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);

/* Configuring Timer_A1 for Up Mode */
MAP_Timer_A_configureUpMode(TIMER_A1_BASE, &upConfig);

/* Enabling interrupts and starting the timer */
MAP_Interrupt_enableSleepOnIsrExit();
MAP_Interrupt_enableInterrupt(INT_TA1_0);
MAP_Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE);

/* Enabling MASTER interrupts */
MAP_Interrupt_enableMaster();

/* Sleeping when not in use */
while (1)
{
u1++;
if(u1%2000==0)
//UART_transmitData(EUSCI_A1_BASE, u1);
MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P2, GPIO_PIN0);
}
}

void TA1_0_IRQHandler(void)
{
Timer_A_clearInterruptFlag(TIMER_A1_BASE);
MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0);
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE,TIMER_A_CAPTURECOMPARE_REGISTER_0);
}

按键中断正常返回主函数继续执行,目前测试了串口中断和定时器中断都不行