ADC accuracy problem

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello guys,

I Have a problem with the accuracy of my ADC. Basically, i think it has to do with the capacitors. I connected one capacitor 100 nF between AREF and GND, but still the results are poor.Any ideas?Is it necessary to place another capacitor between VCC and GND?
:(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Is it necessary to place another capacitor between VCC and GND?

It is always necessary to put a capacitor between VCC and GND regardless of whether you are using the ADC or not. There is also plenty of info in the datasheet on how to reduce noise on the ADC (but your options might vary depending on which AVR you are using).

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanx, I'll follow your advice and see what happens.
John

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also what's the variation in the accuracy.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vin = 4,17 volts while the ADC gives as output 2.93, so around 1 Volt variation, pretty big :S.
I can't figure out how to connect the capacitor between VCC and GND. I can't find VCC on STK500(same with 501)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The STK500 board should allready have the capacitors from VCC to GND and AVCC to AGND. They are allways needed, so they are alleady on board.

There are a few other things to go wrong with the ADC:
- is the adc clock right (50-250 kHz)
more than 1 MHz can cause trouble
- is the signal impedance less than about 20 KoHms ?
- enough delay afer changing the ref. settings ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There may also be a fault in your software.

So give us exact schematic and software.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanx for the responseses guyz,
We tryied all the ADC clock prescalers but there was no change.
The only thing that worked right was changing our Voltage reference to the Internal 2.56 that worked with great accuracy and no capacitor.
We can't get a decent result with all other Voltage references. I can't understand why that happens.
I 'll post some code in a few minutes. Really thanx for the responses guyz, you are a great help

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
adc_init:	
     ldi r16,0x00//(1<<REFS1) | (1<<REFS0) //| (1<<ADLAR)
     out ADMUX,r16
     ldi r16,(1<<ADEN) | (1<<ADPS1) | (1<<ADPS0)
     out ADCSR,r16

readTemp:
	sbi ADCSRA,ADSC;start conversion

	
	wait1:
	sbis ADCSRA,ADIF;wait for conversion to happen
	rjmp wait1

	in ResL,ADCL
	in ResH,ADCH

	sbi ADCSRA,ADIF
	ret
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Read these application notes and follow the hardware design and layout guidelines:
AVR040: EMC Design Considerations
AVR042: AVR Hardware Design Considerations

AVR042 wrote:
2.2 Analog supply
The AVR devices that have built-in ADC have a separate analog supply voltage pin, AVcc. This separate voltage supply is provided to make the analog circuits less prone to the digital noise originating from the switching of the digital circuits.
To be able to obtain good accuracy with the ADC the analog supply voltage must be decoupled separately, in the same manner as the digital supply voltage. If a separate analog ground (AGND) is present, the analog ground should be separated from the digital ground, - so that the analog and digital ground are only connected at one point, - the origin of the GND i.e. at the power supply GND.

Last Edited: Wed. Mar 18, 2009 - 04:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Read these application notes and follow the hardware desig and layout guidelines:

Could partly be quite hard, as the OP seems to use the STK500 board.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All the connections are done with the AVR(AtMega128) being on the STK501. I'll try the code in another STK and see what happens.Thanx for interesting pdf's!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

finally we figured it out..The problem was that the GND of the analog input deffired around 0.7 Volts from the GND of the ADC. We thought that since everything was routed to a central voltage supplier we wouldn't have to connect the GND's together. Once again thanx for the response guys! Spamming over:P