Society of Robots - Robot Forum

Software => Software => Topic started by: silo_xtreme on November 07, 2009, 09:24:59 AM

Title: Weird IR reciever values
Post by: silo_xtreme on November 07, 2009, 09:24:59 AM
Hey All,

Anyone know why I would get values in the range of 65533 - 65535 on an ADC measurement?  I only seem to get this on my IR receiver from my ATXMEGA chip.

I've verified that we're not exceeding any electrical characteristics.

I have an interrupt that keeps sampling the ADC pin and updated a variable.

Could I be sampling too fast or something?  ???
Title: Re: Weird IR reciever values
Post by: bsamuels on November 13, 2009, 10:42:00 PM
Try it with another IR sensor, or another microcontroller and make sure the problem isn't hardware related.
Title: Re: Weird IR reciever values
Post by: silo_xtreme on November 14, 2009, 08:44:44 AM
Heh.  Sorry for not updating this sooner.

The problem is actually cause because the Voltage was too small for the resolution selected on the ADC.

Thanks,

Title: Re: Weird IR reciever values
Post by: bo13th on November 14, 2009, 08:48:41 AM
what type of ADC?
Title: Re: Weird IR reciever values
Post by: silo_xtreme on November 14, 2009, 08:51:16 AM
The Xmega128A1 ADC.

For some reason it was not resolving values less than 1.7 ma.  ???
Title: Re: Weird IR reciever values
Post by: Admin on November 14, 2009, 10:23:52 PM
The Xmega128A1 ADC.

For some reason it was not resolving values less than 1.7 ma.  ???
ma or mV?

Is it 10 bit ADC?
Title: Re: Weird IR reciever values
Post by: silo_xtreme on November 29, 2009, 08:12:43 PM
mV ... Yes, 10 bit.  It ends up being a moot problem since I don't need to filter out ambient light in the s/w ... We have a hardware filter on it ;)
Title: Re: Weird IR reciever values
Post by: Admin on November 29, 2009, 08:16:23 PM
Well

5V/(2^10 bit) = 0.0049 V

or 4.9mV

So getting 1.7mV resolution with a 10 bit system is impossible :P

. . . well, unless you are making assumptions based on a timer in a dynamic system . . .
Title: Re: Weird IR reciever values
Post by: silo_xtreme on November 29, 2009, 08:22:35 PM
Doh!  Now that is good to remember! Thanks.