PDA

View Full Version : 10 Bit A-D Numbers



Peter1960
- 30th April 2006, 07:29
Hi, I am using an A-D Conversion with A-D set at 10 bits.
I seem to be getting numbers from 0 - ~64000.
I thought it should be 0 - 1024 ?
What could I being doing amiss ?
I am using the converted number variable as a word, could this be why?
thnks
Pete

mister_e
- 30th April 2006, 09:12
unless you give your code, we can't and we don't want to bet on what are the possible cause of it.

Acetronics2
- 30th April 2006, 09:14
Hi, Steve

That smells hard a Forgotten Right Justification config ....

Alain

mister_e
- 30th April 2006, 09:19
shhhhut! Shure it could be that or just forgotten bit shifting, depending the method used ;)

...mmm sounds the same... i really need to go to sleep. Bonne nuit a la France ;)

Peter1960
- 30th April 2006, 22:44
Hi,

Just,

I need to write code when I am awake.

I have left justified, thus adressh is bits 3 -10 (0 - 7) and address l is bits 1 -2 (6 -7), thus

values is from 00000000(h) 00000000(l), 00 00 hex , 0000 decimal
to 11111111(h) 11000000(l), FF C0 hex , 65472 decimal

Where if I had right justified, thus adressh is bits 9 - 10 (0 - 1) and address l is bits 1 - 8 (0 - 7), thus

values is from 00000000(h) 00000000(l), 00 00 hex , 0000 decimal
to 00000011(h) 11111111(l), 03 FF hex , 1023 decimal

thks

Peter