I am trying to read an analog input on A3. When I ramp up the voltage to around 2 Volts on the analog input, the ADC value seems to max out at 511. It looks like the 10th bit isn't being used. What register do I need to change to get it to read a full scale of 1023 and use all 10 bits?
/* --------------------------- */
/* EVSE ADC10 Setup */
/* --------------------------- */
/* Prepare the ADC10A for configuration */
ADC10CTL0 &= ~ADC10ENC;
/* Clear pending interrupts to ensure trigger for DMA */
ADC10IFG = 0;
/* ADC on, ADC10 waits for trigger from the SD24, sampling time 2us 8xADCclk, auto next conv. */
ADC10CTL0 = ADC10SHT0 | ADC10ON | ADC10MSC;
/* Triggered by the SD24, SMCLK/6 = 4MHz, Pulse Sample Mode*/
ADC10CTL1 = ADC10SHP | ADC10SHS_0 | ADC10DIV_0 | ADC10SSEL_3 | ADC10CONSEQ_2; /* Single Channel, Repeat Conversion */
/* 10-bit conversion results */
ADC10CTL2 |= ADC10RES;
/* Enable ADC conv complete interrupt */
ADC10IE |= ADC10IE0;
/* A3 ADC input select; Vref=AVCC */
ADC10MCTL0 |= ADC10INCH_3 | ADC10SREF_0;
/* Enable ADC10 interrupts */
//ADC10IE = ADC10IE0 | ADC10OVIE | ADC10TOVIE;
/* Start ADC and wait for a software start conversion trigger */
ADC10CTL0 |= ADC10ENC + ADC10SC;
Thanks,
Mike