how to read

Dear all,

I’m working in voltage monitoring circuit using Op-amp. i want to take the voltage range from op amp to LCD through msp430.I think the output of voltage moniotoring circuit should be fed to port pin of msp430. my doubt is how to read the portpin data(wheather 3.3v or 5v)through the program.Any idea?

Thanks

Naz

Use the ADC.

Leon

ya it’s correct sir,but i’m getting one issue

#pragma vector=ADC12VECTOR

__interrupt void ADC12ISR (void)

{

if (ADC12MEM0 < 0x7FF)

P1OUT &= ~0x01; // Clear P1.0 LED off

else

P1OUT |= 0x01; // Set P1.0 LED on

_BIC_SR_IRQ(CPUOFF); // Clear CPUOFF bit from 0(SR)

}

this is my interrupt program(i got from TI website),but i’m getting error while compiling,it shows like this

Error[Pe020]: identifier “ADC12VECTOR” is undefined.

what i have to do?

Thanks

naz

but i’m giving dc voltage(so we couldn’t use ADC).how it is possible?

Thanks

naz

The ADC will read a DC voltage. If your circuit provides two voltage levels (0V and 3.3V), just use a digital input.

Leon

The ADC you are using probably can only handle DC. Usually, those that handle AC need both positive and negative power where as the MSP430 use positive power only.

The compiler error you asked earlier is probably caused by a typo. I think you dropped a “_”.

Or, use a circuit to convert the AC signal from bipolar to unipolar.

Leon

thank you old cow sir and leon sir.sir i want to measure battery voltage and display it on lcd.now what i have to do?

Thanks

Naz

this is my interrupt program(i got from TI website),but i’m getting error while compiling,it shows like this

Error[Pe020]: identifier “ADC12VECTOR” is undefined.

what i have to do?

I think you use wrong chip! The chip you specify in your project probably doens’t have 12 bit ADC.

Like Leon & OldCow mentioned, you need to do ADC, read the ADC12MEM (if your chip has 12bit ADC) or ADC10MEM , then print that value on the LCD.