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.
#define ADC_BASE_1 ADC1_BASE // ʹÓÃADC0
#define SequenceNum1 3
void Init_Sensor(){
// The ADC0 peripheral must be enabled for use.
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1);
// For this example ADC0 is used with AIN0 on port E7.
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
// Select the analog ADC function for these pins.
ROM_GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_1);
// Enable sample sequence 3 with a processor signal trigger. Sequence 3
ROM_ADCSequenceConfigure(ADC_BASE_1, SequenceNum1, ADC_TRIGGER_PROCESSOR, 0);
// Configure step 0 on sequence 3. Sample channel 0 (ADC_CTL_CH0) in
ROM_ADCSequenceStepConfigure(ADC_BASE_1, SequenceNum1, 0, ADC_CTL_CH6 | ADC_CTL_IE |
ADC_CTL_END);
// Since sample sequence 3 is now configured, it must be enabled.
ROM_ADCSequenceEnable(ADC_BASE_1, SequenceNum1);
// Clear the interrupt status flag. This is done to make sure the
ROM_ADCIntClear(ADC_BASE_1, SequenceNum1);
}
这是我在TIVA C SERIES板子上配置ADC的程序 当我配置完ADC并且下载到板子上之后(程序里我配置了PE1) PE1口不接任何输入也会有电压 其他引脚配置完也是这样 是什么原因呢? 现在我找到了PD1口是配置完之后没有电压的