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.

Tiva LM4F120 ADC结果不稳定



参考差分ADC的例程

相关代码如下:

//ADC
 SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
 GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_2 | GPIO_PIN_3);

 ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
 ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_D | ADC_CTL_CH0 |
                              ADC_CTL_IE | ADC_CTL_END);
 ADCSequenceEnable(ADC0_BASE, 3);
 ADCIntClear(ADC0_BASE, 3);

 

while(1)
 {
  //GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, ~GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_2));

  ADCProcessorTrigger(ADC0_BASE, 3);

  while(!ADCIntStatus(ADC0_BASE, 3, false))
  {
  }
  ADCIntClear(ADC0_BASE, 3);
  ADCSequenceDataGet(ADC0_BASE, 3, pi32ADC0Value);
  sprintf(uchUart0Buf,"%d",pi32ADC0Value[0]);
  OLED_8x16Str(8*3,2,uchUart0Buf);
  SysCtlDelay(ui32SysClockPerSec/2);
 }

不太明白ADC有什么特别的地方?

我测量的是差分信号,但是结果总是有些浮动,请问这是程序有问题还是我的硬件问题?谢谢!