Whenever I perform an ADC conversion, the result is exactly 0. I have tried to enable to correct pins as analog inputs and set the proper voltage reference. However, the result is always zero. Here is what I am doing:
APCFG = 0x40; // Signal is on P0.6 pin (AIN6)
HalAdcSetReference (HAL_ADC_REF_AIN7);
uint16 adcVal = HalAdcRead (HAL_ADC_CHANNEL_6, HAL_ADC_RESOLUTION_8);
Again, I adcVal is always exactly zero. I assume I must be missing a step. Is APCFG = 0x40 correct for P0.6?