Other Parts Discussed in Thread:TMS320F280049
我用EPWM6_SOCA 触发 TMS320F280049 的三个ADC模块 ,每个ADC模块有4个SOC ,
EPWM6_SOCA 触发 adca 的 SOC0 ~ SOC3 ,用SOC3触发 INT_ADCA1 中断。
EPWM6_SOCA 触发 adcb 的 SOC0 ~ SOC3 ,用SOC3触发 INT_ADCB1 中断。
EPWM6_SOCA 触发 adcc 的 SOC0 ~ SOC3 ,用SOC3触发 INT_ADCC1 中断。
刚运行时,三个中断都可以正常进入。运行了一段时间后,有的中断就不能进入,或者三个中断都不能进入。有可能是什么原因?
代码如下。
#define TRIGGER_SOURCE_3 ADC_TRIGGER_EPWM6_SOCA //触发源
三个ADC模块的配置
//adca
ADC_setVREF(ADCA_BASE, ADC_REFERENCE_MODE, ADC_REFERENCE_VOLT);
ADC_setPrescaler(ADCA_BASE,ADC_CLK_DIV);
ADC_setInterruptPulseMode(ADCA_BASE, ADC_PULSE_END_OF_CONV);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, TRIGGER_SOURCE_3,BAT_CHARG_CUR_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER1, TRIGGER_SOURCE_3,MDL_CUR_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER2, TRIGGER_SOURCE_3,PT100A_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER3, TRIGGER_SOURCE_3,OUTPUT_NTC1_CH, SAMPLE_WINDOW);
ADC_setInterruptSource(ADCA_BASE,ADC_INT_NUMBER1,ADC_SOC_NUMBER3); //
ADC_enableInterrupt(ADCA_BASE,ADC_INT_NUMBER1);
Interrupt_enable(INT_ADCA1);
Interrupt_register(INT_ADCA1, &adcaInterrupt_1);
Interrupt_enableInCPU(INTERRUPT_CPU_INT1);
ADC_enableConverter(ADCA_BASE);
//adcb
ADC_setVREF(ADCB_BASE, ADC_REFERENCE_MODE, ADC_REFERENCE_VOLT);
ADC_setPrescaler(ADCB_BASE,ADC_CLK_DIV);
ADC_setInterruptPulseMode(ADCB_BASE, ADC_PULSE_END_OF_CONV);
ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER0, TRIGGER_SOURCE_3,BAIS_FAULT_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER1, TRIGGER_SOURCE_3,PT100B_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER2, TRIGGER_SOURCE_3,OUTPUT_NTC2_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER3, TRIGGER_SOURCE_3,OUTPUT_NTC2_CH, SAMPLE_WINDOW);
ADC_setInterruptSource(ADCB_BASE,ADC_INT_NUMBER1,ADC_SOC_NUMBER3); //
ADC_enableInterrupt(ADCB_BASE,ADC_INT_NUMBER1);
Interrupt_enable(INT_ADCB1);
Interrupt_register(INT_ADCB1, &adcbInterrupt_1);
Interrupt_enableInCPU(INTERRUPT_CPU_INT1);
ADC_enableConverter(ADCB_BASE);
//adcc
ADC_setVREF(ADCC_BASE, ADC_REFERENCE_MODE, ADC_REFERENCE_VOLT);
ADC_setPrescaler(ADCC_BASE,ADC_CLK_DIV);
ADC_setInterruptPulseMode(ADCC_BASE, ADC_PULSE_END_OF_CONV);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER0, TRIGGER_SOURCE_3,LOAD_VOLT_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER1, TRIGGER_SOURCE_3,BAT_DISCHARG_CUR_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER2, TRIGGER_SOURCE_3,MDL_VOLT_CH, SAMPLE_WINDOW);
ADC_setupSOC(ADCC_BASE, ADC_SOC_NUMBER3, TRIGGER_SOURCE_3,CRTL_BOARD_TEMP_CH, SAMPLE_WINDOW);
ADC_setInterruptSource(ADCC_BASE,ADC_INT_NUMBER1,ADC_SOC_NUMBER3); //
ADC_enableInterrupt(ADCC_BASE,ADC_INT_NUMBER1);
Interrupt_enable(INT_ADCC1);
Interrupt_register(INT_ADCC1, &adccInterrupt_1);
Interrupt_enableInCPU(INTERRUPT_CPU_INT1);
ADC_enableConverter(ADCC_BASE);
三个中断函数。
__interrupt void adcaInterrupt_1(void)
{
ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
__interrupt void adcbInterrupt_1(void)
{
ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER1);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
__interrupt void adccInterrupt_1(void)
{
ADC_clearInterruptStatus(ADCC_BASE, ADC_INT_NUMBER1);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
user1601657:
仿真时:
中断标志:ADCINTFLAG.ACINT1 已经置位
中断使能:ADCINTSEL1N2.INT1SEL 已经置位
同时,中断溢出标志ADCINTOVF.ACINT1 也置位
就是进不了中断
,
Green Deng:
你好,我将您的问题升级到了E2E英文论坛,你可以关注以下帖子中FAE的回复:e2e.ti.com/…/933891
,
TYB T:
楼主解决了么