Part Number:TMS320F28377SOther Parts Discussed in Thread:C2000WARE
1541.Sigle_Sawtooth_wave.zip
cong huang:
Single_wave.zip
,
Susan Yang:
请问还是之前的问题?
我试了一下,可以进入 cpu_timer1_isr 和 cpu_timer0_isr的
中断一直进不去“”
能否详细说明一下?
,
cong huang:
您好,之前按照您说的,用EPwm来触发AD采样,我根据例程改的,但是不能进入中断(无法传出采样值),但是可以采到.
,
Susan Yang:
好的 我后面重新测试一下
,
Susan Yang:
您的代码内没有如下配置?
// // SetupADCEpwm - Setup ADC EPWM acquisition window // void SetupADCEpwm(Uint16 channel) {Uint16 acqps;//// Determine minimum acquisition window (in SYSCLKS) based on resolution//if(ADC_RESOLUTION_12BIT == AdcaRegs.ADCCTL2.bit.RESOLUTION){acqps = 14; //75ns}else //resolution is 16-bit{acqps = 63; //320ns}////Select the channels to convert and end of conversion flag//EALLOW;AdcaRegs.ADCSOC0CTL.bit.CHSEL = channel;//SOC0 will convert pin A0AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps; //sample window is 100 SYSCLK cyclesAdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //trigger on ePWM1 SOCA/CAdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0; //end of SOC0 will set INT1 flagAdcaRegs.ADCINTSEL1N2.bit.INT1E = 1;//enable INT1 flagAdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //make sure INT1 flag is clearedEDIS; }
,
cong huang:
有的,函数名字为
void SetupADCSoftware(void);在Adc.c文件中。
,
cong huang:
换成其他的通道结果一样,进不去中断
,
Susan Yang:
我测试了一下是会卡在下面的语句
// //wait while ePWM causes ADC conversions, which then cause interrupts, //which fill the results buffer, eventually setting the bufferFull //flag // while(!bufferFull); bufferFull = 0; //clear the buffer full flag
即没有进入ADC的中断服务程序。请您直接使用TI例程来测试一下
C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2837xs\examples\cpu1\adc_soc_epwm
若是例程可以的话,那就应该是您的软件配置问题,请您对照例程看一下