各位大牛好: 小弟请教一下lm3s615中的采样平均功能怎么用,它可以使AD的精度得到多大提高,我是在使能采样序列0之前,这样ADC_SAC_R|=0x2;设置的,不过加上这句后,就在循环那等着了,fifo满地标志没置,空洞标志也没清除。 SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC); // 使能ADC模块的时钟() SysCtlADCSpeedSet(SYSCTL_ADCSPEED_500KSPS); ADCSequenceDisable(ADC_BASE, 0); // 禁能所有采样序列 ADCSequenceConfigure(ADC_BASE, 0,ADC_TRIGGER_ALWAYS,0); ADCSequenceStepConfigure(ADC_BASE, 0, 0, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 1, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 2, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 3, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 4, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 5, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 6, ADC_CTL_CH0 ); ADCSequenceStepConfigure(ADC_BASE, 0, 7, ADC_CTL_CH0|ADC_CTL_END); ADC_SAC_R|=0x2; ×××××× ADCSequenceEnable(ADC_BASE, 0);
for(i=0;i<8;i++) {
while((ADC_SSFSTAT0_R&0x1000)==0); ADC_Value=HWREG(ADC_SSFIFO0_R);
} } |