I am developing an application where i can take analog readings on port 7.0 of MSP430F5529 (A12 channel of LCD), I am using variable resistance to take reading on port 7.0 (Channel A12). on board ADC12, Using the Internal Reference, The ADC12 uses the internal 2.5V reference and performs a single conversion on channel A12. The conversion results are stored in ADC12MEM0. Test by applying a voltage to channel A12, then setting and running to a break point at the "__no_operation()" instruction. I want sampled values to be displayed on onboard LCD.
for this i am using code
#include <msp430f5529.h>
void main(void)
{
volatile unsigned int i;
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
P7SEL |= 0x01; // Enable A/D channel A0
REFCTL0 &= ~REFMSTR; // Reset REFMSTR to hand over control to
// ADC12_A ref control registers
ADC12CTL0 = ADC12ON+ADC12SHT02+ADC12REFON+ADC12REF2_5V;
// Turn on ADC12, Sampling time
// On Reference Generator and set to
// 2.5V
ADC12CTL1 = ADC12SHP; // Use sampling timer
ADC12MCTL0 = ADC12SREF_1; // Vr+=Vref+ and Vr-=AVss
for ( i=0; i<0x30000; i++); // Delay for reference start-up
ADC12CTL0 |= ADC12ENC; // Enable conversions
while (1)
{
ADC12CTL0 |= ADC12SC; // Start conversion
while (!(ADC12IFG & BIT0));
__no_operation(); // SET BREAKPOINT HERE
}
}
Now i want further Program such that whatever value ADC takes it should display it on onboard LCD and stores onto the Register ADC12MEM0 as well. Further ADC12_A related details can be found out on SLAU208K document on Page No. 722. I stuck in the programming where i am not able to display the Variable resistance (Voltage Levels) value on LCD. Can anyone write further Program with Function to display Voltage level / Equivalent decimal or HEX value onto the LCD for single conversion ?