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.

过零检测产生断口中断,开始ADC转换 MSP430F5529



由P2.0作为ZeroCrossing Input,中断条件是检测到low->high,寄存器设置如下:

P1DIR |= BIT0; 
P2REN |= BIT0; 
P2OUT |= BIT0; 
P2IES &= ~BIT0; 
P2IFG &= ~BIT0; 
P2IE |= BIT0;

__bis_SR_register(LPM3_bits + GIE); 

在中端中执行ADC转换,ADC函数包括Timer寄存器设置,Timer触发的ADC寄存器设置以及DMA寄存器设置,转存大小为2000。之后清端口中断。
能够build,debug也不报错,但是好象不能执行,请问各位问题是出在什么地方?

  • 你这样问问题是没法回答的,建议你按照如下步骤操作检查错误:

    1、 测试端口中断是否产出?关闭其他所有功能,只测试端口中断是否发生。

    2、测试TIMER是否工作? 端口中断正确后,设置TIMER和ADC,并检测ADC采样结束中断。