Other Parts Discussed in Thread: TM4C123GH6PZ, STRIKE
Hi,
I've ported my software from a stellaris controller to the new Tiva TM4C123GH6PZ. Now I have some trouble with that.
On our project, we use an external 3 V reference voltage for the ADC. I've set the reference to the external voltage in the ADCCTL register but the sampled values aren't in that range I expected.
It seems that the adc still uses the internal reference voltage. A change in the ADCCTL has no effect.
Here is my source code to set up the ADC:
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_5); GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_4); GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3);
GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_2); GPIOPinTypeADC(GPIO_PORTD_BASE, GPIO_PIN_0); GPIOPinTypeADC(GPIO_PORTD_BASE, GPIO_PIN_1); ADCSequenceConfigure(ADC0_BASE, ADC_SEQUENCE_NUMBER, ADC_TRIGGER_PROCESSOR, 0); ADCSequenceStepConfigure(ADC0_BASE, ADC_SEQUENCE_NUMBER, 0, ADC_CTL_CH0 | ADC_CTL_IE | ADC_CTL_END); ADCReferenceSet(ADC0_BASE, ADC_REF_EXT_3V); ADCSequenceEnable(ADC0_BASE, ADC_SEQUENCE_NUMBER); ADCIntClear(ADC0_BASE, ADC_SEQUENCE_NUMBER);
Hope you can help me with this problem.