16 to 24 Bit A-to-D Converter Recommendation
dre
Posts: 106
Hi,
I am in need of and A-to-D converter which would take full advantage of a Stamp 'word'
size variable [noparse][[/noparse]i.e. 16 to 24 bits]. Two essentials however: 1] It must be in DIP
configuration as I am not skilled in more precise soldering, and 2] I need the snippet of
BPasic coding to use it with the regular series of Stamps.
It is desirable if it has multichannel input and uses a single power supply.
The only converter I have noticed is the ADS1211P but the datasheet totally alludes me
as to PBasic code generation.
Any suggestions?
cheers, David
I am in need of and A-to-D converter which would take full advantage of a Stamp 'word'
size variable [noparse][[/noparse]i.e. 16 to 24 bits]. Two essentials however: 1] It must be in DIP
configuration as I am not skilled in more precise soldering, and 2] I need the snippet of
BPasic coding to use it with the regular series of Stamps.
It is desirable if it has multichannel input and uses a single power supply.
The only converter I have noticed is the ADS1211P but the datasheet totally alludes me
as to PBasic code generation.
Any suggestions?
cheers, David
Comments
what do you mean with "take full advantage of the stamp's word size variable"? Developing and laying out
circuitry which make reasonable use of 16bit ADC is a challenge even to experts. Even more so for 24bits.
If not really carefully layed out the lower bits will be mere noise (1LSB/16bit @ 5V = 80uV; 1LSB/24bit @ 5V = 0.3uV).
If you just need the dynamic range of the 16bit word variable for computations you can always use that with an
8- to 12bit ADC by shifting the ADC bits into the variable bits where you need them.
regards
adrian
Thanks for the informative reply.
Yes, I believe all I need is the "dynamic range of the 16bit word variable". I have never
come across the procedure of "shifting the ADC bits into the variable bits". Could you
explain further; perhaps by listing a snippet of PBasic code?
At present I am using the 12bit TLC2543 ADC and using Dr. Tracy Allen's code:
Low ADcs ' select chip
SHIFTOUT sdo,sclk,msbfirst,[noparse][[/noparse]ADch<<8\12] ' mode, left justify ADch
SHIFTIN sdi,sclk,msbpre,[noparse][[/noparse]result\12] ' get result, 12 bits
HIGH ADcs ' deselect chip
Reference: www.emesystems.com/OL2tlc2543.htm
cheers, David
'·· {$PBASIC 2.5}
'Heres some code I pulled out of a program I'm running. Analog Devices ADC0838 8 channel.
'The result0 and result1 are the untouched values directly read from the ADC0838. The rest
' of the VAR's are used for my particular application. Jumper pin 14 to 17 of the ADC0838 and
' it will use the DataIO pin 1 of the Basic Stamp for both inputing and outputing of data.
Clk················ PIN···· 0·············· ' Clock pin 16 ADC0838
DataIO··········· PIN···· 1·············· ' Data out and in on ADC (Pin 14&17 ADC0838)
ChipSelect······ PIN···· 2·············· ' Chip select O2 voltages (Pin 18 ADC0838)
result0··········· ·VAR···· Byte····················· 'Raw ADC bits read from CH0
result1··········· ·VAR···· Byte····················· 'Raw ADC bits read from CH1
VoltsA0·········· ·VAR···· Nib
VoltsA1·········· ·VAR···· Nib
VoltsB0·········· ·VAR···· Byte
VoltsB1·········· ·VAR···· Byte
Remainder0······ VAR···· Byte
Remainder1······ VAR···· Byte
· LOW ChipSelect··············································· ' Enable ADC
· SHIFTOUT DataIO, Clk, MSBFIRST, [noparse][[/noparse]%11000\5 ]···· ' Select CH0, Single-Ended
· SHIFTIN DataIO, Clk, MSBPOST, [noparse][[/noparse]result0\8]···········' Read ADC0838 Channel 0
· HIGH ChipSelect···············································' Disable ADC
· VoltsA0 = 5 * result0 / 255································' 5volts x ADC value/255 bits, Left of decimal point
· Remainder0 = 5 * result0 // 255························· ' Remainder calc
· VoltsB0 = 100 * Remainder0 / 255······················ ' Values for Right of decimal point
·
·LOW ChipSelect·············································· · ' Enable ADC
· SHIFTOUT DataIO, Clk, MSBFIRST, [noparse][[/noparse]%11100\5 ]···· ' Select CH1, Single-Ended
· SHIFTIN DataIO, Clk, MSBPOST, [noparse][[/noparse]result1\8]·········· ' Read ADC0838 Channel 1
· HIGH ChipSelect··············································· ' Disable ADC
· VoltsA1 = 5 * result1 / 255······························· ·' 5volts x ADC value/255 bits, Left of decimal point
· Remainder1 = 5 * result1 // 255···························' Remainder calc
· VoltsB1 = 100 * Remainder1 / 255······················· ' Values for Right of decimal point
it is 24 bit
Thanks for the code. But I am confused.
I note that the variables "result0 & result1", the raw data downloaded from the ADC, are
defined as being 'byte' length. As such how can you get any resolution higher than 1 part
in 255?
be80be
Thanks for the recommendation but the MAX11040 can only be purchased in surface mount
configuration; except for the evaluation board, which costs some $340.
cheers, David
-Phil
As in your code the result from the ADC is stored in a word variable like below. Thus you can multiply with up to 16
-- or shift left by up to 4bit -- without dropping bits of your ADC result:
0000 XXXX XXXX XXXX 12bit result in 16bit variable, right adjusted
000X XXXX XXXX XXX0 *2, <<1
00XX XXXX XXXX XX00 *4, <<2
0XXX XXXX XXXX X000 *8, <<3
XXXX XXXX XXXX 0000 *16, <<4
On the other hand, is you would shift your ADC result left by 4 to fill the uppermost bits of the word variable
you could divide by up to 16 -- or shift right by up to 4bit -- without losing ADC result bits.
XXXX XXXX XXXX 0000 12bit result in 16bit variable, left adjusted
0XXX XXXX XXXX X000 /2, >>1
0XXX XXXX XXXX X000 /4, >>2
000X XXXX XXXX XXX0 /8, >>3
0000 XXXX XXXX XXXX /16, >>4
To make it short, you don't need more bits in your ADC to use the dynamic range of a word size variable. Its just
binary arithmetic. Of course you could gain even more dynamic range by using 32bit arithmetic and two word
variables. Tracy Allen's web site (EME Systems) would be a good resource on that subject.
Regards
Adrian
I want to thank all who replied. Although I didn't get results I can use directly, I did get a
good deal of excellent recommendations to contemplate.
For the time being I will stick with the 12 bit ADC I am currently using. I will try
experimenting; maybe 'switching' in the immediate area of concern of the variable prior
to the conversion.
.
[noparse][[/noparse]I once heard a lecture given by Charles F. Kettering [noparse][[/noparse]of GM & Sloan-Kettering fame] in
which he mentioned that, when he called a meeting of his engineers, he displayed a
velvet-lined box at the entrance with the note for all engineers to leave their sliderules in
the box. He didn't want anyone whipping out his sliderule in respond to his technical
discussion and, using Handbook formulas and sliderule calculations, state that, "it couldn't
be done".]
Now thats', 'thinking outside the box'.
Again, my thanks,
David