Hi,
I use ADC12 of msp430f1611.but I have some problem with the ADC12
precision.
The analog input is 0(no signal), but the ADC conversion value sometimes
change of about 0 to 256 points(256/4095). But the input hat signal, the
ADC conversion value is good and stabil.
How can I do?
Thank you
Here is the code:
void main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
P6SEL = 0X3C; // Enable A/D channel inputs
ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling
time
// to avoid overflow of results
ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated
sequence
ADC12MCTL0 = SREF_2+INCH_2; // ref+=VeREF, channel = A0
ADC12MCTL1 = SREF_2+INCH_3; // ref+=VeREF, channel = A1
ADC12MCTL2 = SREF_2+INCH_4; // ref+=VeREF, channel = A2
ADC12MCTL3 = SREF_2+INCH_5+EOS; // ref+=VeREF, channel = A3, end
seq.
ADC12IE =0X08; // Enable ADC12IFG.3
ADC12CTL0 |= ENC; // Enable conversions
ADC12CTL0 |= ADC12SC; // Start conversion
_BIS_SR(LPM0_bits +GIE); // Enable interrupts
}
#pragma vector=ADC_VECTOR
__interrupt void ADC (void)
{
static unsigned int index = 0;
A0results[index] = ADC12MEM0; // Move A0 results, IFG is
cleared
A1results[index] = ADC12MEM1; // Move A1 results, IFG is
cleared
A2results[index] = ADC12MEM2; // Move A2 results, IFG is
cleared
A3results[index] = ADC12MEM3; // Move A3 results, IFG is
cleared
index = (index+1)%8; // Increment results index,
modulo;
}
ok ,schreibe ich auf Deutsch. Stefan Shröder wrote: > Hallo, > Ich benutze ADC12 von msp430f1611.aber Ich habe ein problem über ADC12 > . > der analog Eingang ist 0(Kein signal), aber ADC conversion value manchmal > change von 0 bis 256 Punkte(256/4095). Aber das Eingangsignal habe Signal, Die > ADC conversion value ist stabil. > Ist mit der Schaltung zu tu oder mit der Programierung zu tu? > > > Danke schön!
Is the ADC-Input really zero? Or left open? Or with resistor tied to ground? If so, what is the value of this resistor?
Ich hatte ein ähnliches Problem. Ursache war ein zu kleiner Kondensator an Vef. siehe auch Beitrag "Re: MSP430 Erfahrungsaustausch zu ADC12 gesucht"
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.