[Tinyos-devel] left alignment of ADC values in tinyos-2.x/tos/chips/atm128/adc/AdcP.nc

Razvan Musaloiu-E. razvanm at cs.jhu.edu
Sat Jun 24 13:33:16 PDT 2006


Hi!

On Fri, 23 Jun 2006, David Gay wrote:

> On 6/23/06, Razvan Musaloiu-E. <razvanm at cs.jhu.edu> wrote:
> > I noticed that the ADC data for Atmega128 is requested to be left aligned.
> > This might allow higher speed in low-resolution (8 bit) sampling but it
> > also generates strange values due to nx conversions (the maximum 0x3FF
> > value becomes 0xCFF). Is this a known or accepted behavior?
>
> Actually the motivation is to provide more consistency of values
> across different A/D precisions (i.e., across different platforms
> and/or sensorboards with their own A/D converters).

Acknowledge. :-)

> I'm completely unclear about what the "a strange value due to nx
> conversion" can be - can you elaborate? (the nx_uint16_t type has the
> same range of values as uint16_t, and the maximum value of a
> left-aligned atmega128 sample value is 0xffc0)

Correct. What I said in my first post (that the max is 0xCFF) is wrong. I
checked again and I'm getting 0xFFC0 which makes perfect sense. :-)

Thank you!
Razvan ME



More information about the Tinyos-devel mailing list