I need 8-bit values from the A/D converter. Selecting 8-bit conversions returns more than 8 bits of data.
ADC12CTL2 |= ADC12RES_0; // 8-bit conversion results
Is there another setting I'm missing? Here is my setup code for the A15 input:
//init A/D
P3SEL1 |= BIT3; // Enable A/D channel A15
P3SEL0 |= BIT3;
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode to activate previously configured port settings
// By default, REFMSTR=1 => REFCTL is used to configure the internal reference
while(REFCTL0 & REFGENBUSY); // If ref generator busy, WAIT
REFCTL0 |= REFVSEL_0 | REFON; // Select internal ref = 1.2V
ADC12CTL0 = ADC12SHT0_2 | ADC12ON;
ADC12CTL1 = ADC12SHP; // ADCCLK = MODOSC; sampling timer
ADC12CTL2 |= ADC12RES_0; // 8-bit conversion results
ADC12MCTL0 |= ADC12INCH_15 | ADC12VRSEL_1; // A15 ADC input select; Vref=1.2V
while(!(REFCTL0 & REFGENRDY)); // Wait for reference generator to settle
ADC12CTL0 |= ADC12ENC; // Enable conversions
while(1)
{
ADC12CTL0 |= ADC12SC; // Start conversion-software trigger
while (!(ADC12IFGR0 & BIT0));
temp = ADC12MEM0; // Read conversion result -----> Reads > 8-bit values - need all answers to be from 00-FF.....
}
Thanks,
Don