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、QEI模块初始化后,程序以运行就进入错误中断是什么原因呢?



ADC初始化程序如下

void
ADCInit(void)
{
//
// 将对应的GPIO引脚配置为ADC模式
//
GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_1|GPIO_PIN_2);

ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_TIMER, 0);
ADCSequenceStepConfigure(ADC0_BASE, 0, 0, ADC_CTL_CH0);
ADCSequenceStepConfigure(ADC0_BASE, 0, 1, ADC_CTL_CH1|ADC_CTL_END | ADC_CTL_IE );

//
// Enable sample sequence zero and its interrupt.
//
ADCSequenceEnable(ADC0_BASE,0);
ADCIntClear(ADC0_BASE, 0);
ADCIntEnable(ADC0_BASE, 0);
IntEnable(INT_ADC0SS0);

}

QEI初始化程序如下

void Init_QEI(void)
{
//指定对应的GPIO引脚为对应的QEP信号输入引脚
GPIOPinConfigure(GPIO_PD6_PHA0);
GPIOPinTypeQEI(GPIO_PORTD_BASE, GPIO_PIN_6);
GPIOPinConfigure(GPIO_PD7_PHB0);
GPIOPinTypeQEI(GPIO_PORTD_BASE, GPIO_PIN_7);
GPIOPinConfigure(GPIO_PF4_IDX0);
GPIOPinTypeQEI(GPIO_PORTF_BASE, GPIO_PIN_4);

//配置QEI对应引脚输入电平及方式
GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_6,
GPIO_STRENGTH_4MA,GPIO_PIN_TYPE_STD);
GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_7,
GPIO_STRENGTH_4MA,GPIO_PIN_TYPE_STD);
GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4,
GPIO_STRENGTH_4MA,GPIO_PIN_TYPE_STD);

//配置QEI模块为AB两路正交编码信号双边沿捕获,索引脉冲不对位置进行复位,无相位交换,编码器为1024线
QEIConfigure(QEI0_BASE,(QEI_CONFIG_CAPTURE_A_B | QEI_CONFIG_NO_RESET |
QEI_CONFIG_QUADRATURE | QEI_CONFIG_NO_SWAP), 4095);

//设置速度计算定时器时中频率为10KHz
QEIVelocityConfigure(QEI0_BASE, QEI_VELDIV_1, SysCtlClockGet()/5000);

//使能速度计算,使能QEI
QEIVelocityEnable(QEI0_BASE);
QEIEnable(QEI0_BASE);

//速度计时器计时完成时触发中断
QEIIntEnable(QEI0_BASE,QEI_INTTIMER);
IntEnable(INT_QEI0);

}

程序一运行就进入这个死循环

//*****************************************************************************
//
// This is the code that gets called when the processor receives a fault
// interrupt. This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//
//*****************************************************************************
static void
FaultISR(void)
{
//
// Enter an infinite loop.
//
while(1)
{
}
}

求指教问题出在哪里?谢谢!