SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By naz
#77106
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
User avatar
By leon_heller
#77113
Use the ADC.

Leon
By naz
#77121
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
By naz
#77189
but i'm giving dc voltage(so we couldn't use ADC).how it is possible?

Thanks
naz
User avatar
By leon_heller
#77190
The ADC will read a DC voltage. If your circuit provides two voltage levels (0V and 3.3V), just use a digital input.

Leon
By OldCow
#77191
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 "_".
User avatar
By leon_heller
#77205
Or, use a circuit to convert the AC signal from bipolar to unipolar.

Leon
By naz
#77322
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
By ThanhTran
#81676
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.