基于CCS6.2的平台上针对DSP2812进行的代码测试,关于ADC模块的初始化代码如下:
void F281X_ileg2_dcbus_drv_init(ILEG2DCBUSMEAS *p)
{
DELAY_US(ADC_usDELAY);
AdcRegs.ADCTRL1.all = ADC_RESET_FLAG;
asm(" NOP ");
asm(" NOP ");
AdcRegs.ADCTRL3.bit.ADCBGRFDN = 0x3;
DELAY_US(ADC_usDELAY);
AdcRegs.ADCTRL3.bit.ADCPWDN = 1;
AdcRegs.ADCTRL3.bit.ADCCLKPS = 6;
DELAY_US(ADC_usDELAY);
AdcRegs.ADCTRL1.all |= ADCTRL1_INIT_STATE;
AdcRegs.ADCTRL2.all |= ADCTRL2_INIT_STATE;
AdcRegs.ADCMAXCONV.bit.MAX_CONV1|= 0x0007;
AdcRegs.ADCCHSELSEQ1.all = p->ChSelect;
EvaRegs.GPTCONA.bit.T1TOADC = 1;
}
当屏蔽其中两条语句(AdcRegs.ADCTRL3.bit.ADCBGRFDN = 0x3;和AdcRegs.ADCTRL3.bit.ADCPWDN = 1;)时,程序可以正常的进行Debug调试(不过此时AD功能等于未启用);当开通上述两条语句的时候不能正常进入EV定时中断(现象上中断中设置的用户计数器显示异常,为0或2989);并且会在console界面中报出如下故障信息:
C28xx: Failed CPU Reset: (Error -1137 @ 0x6) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 7.0.48.0)
C28xx: Trouble Reading Register PC: (Error -1137 @ 0x0) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 7.0.48.0)
C28xx: Trouble Reading Register ST1: (Error -1137 @ 0x6) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 7.0.48.0)
C28xx: GEL: Error while executing OnReset(1): Target failed to read register ST1
at (ST1&~(0x0100)) [f2812.gel:286]
at C28x_Mode() [f2812.gel:38]
at OnReset(1)
上述问题查了良久不得要领,请TI的工程师及各位江湖高手帮助分析,谢谢了。



