I'm having a hard time getting my ADC to work. I've followed the example and datasheets to get a sample from P0_2, but can't seem to get a full 0-1023 range that I should with a 10 bit ADC. From the datasheet, I should be maxing out at 1.2V, but I only get a value around 320 when I test it in the debugger with the pin connected to a power supply.
This is the code I use:
sample = adc_get_sample();
I've reserved the pin as follows:
RESERVE_GPIO( ADC, GPIO_PORT_0, GPIO_PIN_2, PID_ADC );
Please let me know if anyone has successfully gotten an ADC pin to read the whole range.