Best ADC Object for Newbies
william chan
Posts: 1,326
Hi,
I am trying to find a ADC object using 2 pins on the propeller to perform ADC on a op-amp output.
Which is the best object in the OBEX to use?
What should be the best values for the resistors and capacitors?
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
I am trying to find a ADC object using 2 pins on the propeller to perform ADC on a op-amp output.
Which is the best object in the OBEX to use?
What should be the best values for the resistors and capacitors?
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
Comments
The Microphone to VGA object for the Propeller Demo board is a good one to start with.
Goto the obex website ( Parallax object library site)
Disect that asm code and you have a good a/d converter..
Look at the schematic of the Propeller Demoboard as well...it is all there mate..
Let your fingers do the walking...
cheers Ron Mel OZ..
Thanks for your kind reply.
But that ADC is not an object but is the Top Object File.
That makes it more difficult to understand, furthermore it is in assembly...
1. How do I turn this Top Object File to a normal object file?
How to add a get_sample_value method to this file to simplify reading the ADC value?
2. Is "asm_sample" the value that I should be reading?
3. When using the SX, I usually use a 10k resistor to reduce loading to the ADC and another 10k resistor for the feedback pin.
In the case of the Propeller Demo board, no resistors are used to reduce loading by the ADC and a 100K resistor is used for the feedback. Is this ok?
4. For the SX, only one capacitor is used to stabilize the ADC sampling point to ground.
In the Propeller Demo board, one more capacitor (1nF) is connected at the sampling pin to Vdd.
What is the effect of this second capacitor?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
So to correct my first sentence, the Propeller has 32 1-bit ADCs.
This can be utilized to implemenet a Delta Sigma Modulator, which consisists in the simplest case of two resistors and a cap. (For HF symmetry considerations two caps are used, this is of no logical significance)
This is the circuit you find on the DemoBoard, and there have been some programs written for it.
It can be more convenient to connect a classical ADC, a no-nonsense converter is the PCF8591, which however has a low bandwidth due to its I2C interface, which on the other hand makes it ready to use with all I2C programs, see my example some weeks ago..
The OBEX is full of objects for other ADCs
Post Edited (deSilva) : 3/10/2008 9:43:11 AM GMT
You are right when you say 2 resistors and a cap are need for a Prop ADC.
But in the Prop Demo Board schematic, only one 100K resistor is used. Why is that so?
(The other 10K resistor is only there bias the Mic.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
The both resistors have to be scaled such that (Uin-1,65V)/Rin = (Ufb-1,65V)/Rfb are in equilibrium. The value selected is 1,6V/100k = 16 µA. When the AC current from the mic does not exceed this value, no additional resistor is neded.
The value ofthe cap(s) is of subordinate significance.
Post Edited (deSilva) : 3/10/2008 6:24:16 AM GMT
That Microphone circuit on the Propeller demoboard is awesome..
It picks up noises from meters away..
Play with the settings in the Attenuator area..
We are using that board on a test jig .. it pick up the sound of a falling object
and it triggers something... secret from there on...
cheers ron mel oz
www.rayslogic.com/propeller/Programming/ADC.htm
The way you took the Mic2VGA Demo and simplified it and added your own get_sample routines are ingenious !
Thanks a million.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
But it needs no Demo and no Simplification...
This is obvious from the start... Sorry, couldn't avoid this.
The link above goes to Raymans's website, so it should read:
"Rayman,
The way you took the Mic2VGA Demo and simplified it and added your own get_sample routines are ingenious !
Thanks a million."