ADC Offset on 644P

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

Hello all.
I am having problems reading values below 19mV with ref 1.1 and 30mV with ref Vcc on a Atmega 644P. Values are fine at levels above this. Any ideas. Vcc is 3V3 ref is Ext 0.1uF to 0V.

So 1-1023dec is 19mV-2.567V

Geoff

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

It would be helpful to know the sign and magnitude of the error, whether it is always the same or varies, etc.

Are you attempting differential conversion? That is not supported with Aref below 2 volts. Also, according to the datasheet, differential conversions are not guaranteed to work in DIP packaged devices, for some reason.

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

Quote:

So 1-1023dec is 19mV-2.567V

How can that be with a 1.1V reference?

How can that be with a 3.3V reference?

Do you get 0 counts at 0V?

Let's assume you have a signal or voltage source that you can use to reliably generate these very fine voltage increments, and a proven reliable device to measure the actual voltage at the AVR pin. Tell the voltage on the pin as it ramps from 0V to whatever, and the corresponding ADC counts.

My first guess would be ripple somewhere.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

RESET, Sorry all I have the wrong data sheet.

Many thanks.

Geoff.

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

Ok the data sheet explains the 2.56V ref the one I was using only had Vcc or 1.1V. But the low 19mV is still a problem. Maybe be its the P version giving me the issues? I have a 10K pot giving the output voltage into single ended ADC mode the reading is sent to a colour touch screen is completely stable, no jumping or wobble. At 0 it's zero at 19-20mV it's one and 2.56 its 1023 I will work on up the scale to see how linear it is I think.

Geoff

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

geoffhackett wrote:
Ok the data sheet explains the 2.56V ref the one I was using only had Vcc or 1.1V. But the low 19mV is still a problem. Maybe be its the P version giving me the issues?
I doubt it. The 'P' indicates a 2.7V device. A 644PV operates down to 1.8V, and has a maximum clock speed of 10 MHz. ADC performance should be unaffected.
Quote:
I have a 10K pot giving the output voltage into single ended ADC mode the reading is sent to a colour touch screen is completely stable, no jumping or wobble. At 0 it's zero at 19-20mV it's one and 2.56 its 1023 I will work on up the scale to see how linear it is I think.
20 mV over 2.56 V represents 8 LSB. That's a pretty high offset, you should expect to see at most 3.5 LSB total error in single-ended mode.

Post your schematic and a minimal piece of test code that reproduces the problem.

JJ

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

I think I have an issue maybe running outside the IC spec. 3V3 Vcc @20Mhz. On the 644P. I could try 5V?

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

geoffhackett wrote:
I think I have an issue maybe running outside the IC spec. 3V3 Vcc @20Mhz. On the 644P. I could try 5V?
You should've put that info in the OP. Try it at the speed it's rated for at that Vcc and see what you get.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

geoffhackett wrote:
I think I have an issue maybe running outside the IC spec. 3V3 Vcc @20Mhz. On the 644P. I could try 5V?
Page 329 of the datasheet. At 3.3 V, the fastest you should run is 13.33 MHz. The lowest voltage you should run at 20 MHz is 4.5 V. You might run outside these specs, but you shouldn't count on it. As for the ADC, since it runs on a prescaled clock, in theory it shouldn't matter, but there's no telling what operating out of spec will do.

BTW, what prescaler are you using?

JJ

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

As I said at first I was using the wrong data sheet so I made an error in the spec. I devil is in the detail. Sorry.