Using a cog as an ADC
Technic-R-C
Posts: 117
Hello Folks,
On page 95 of the propeller manual it states that a cog can be configured to do Analog-to-Digital Conversions (ADC).
How would one go about reading values from an external sensor and then configuring a cog to act as a 12 bit A/D converter?
Is this possible, or would I be better of just purchasing an 12 bit A/D converter from parallax?
Thank you
Technic-R-C
Post Edited (Technic-R-C) : 10/13/2009 12:36:09 AM GMT
On page 95 of the propeller manual it states that a cog can be configured to do Analog-to-Digital Conversions (ADC).
How would one go about reading values from an external sensor and then configuring a cog to act as a 12 bit A/D converter?
Is this possible, or would I be better of just purchasing an 12 bit A/D converter from parallax?
Thank you
Technic-R-C
Post Edited (Technic-R-C) : 10/13/2009 12:36:09 AM GMT
Comments
There are simple RC circuits for sigma-delta which do a nice job on voice band AC signals and you could of course use the old RC timing circuit in a variety of ways as well. The Prop however lacks a comparator so it's switching threshold is process and temperature dependent and also sensitive to noise.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
http://forums.parallax.com/forums/default.aspx?f=25&m=384748&p=1&ord=a
http://forums.parallax.com/showthread.php?p=839912
After·reading here and there about·A/D conversions using just one cog, I have sadly come to the conclusion that I am, at the moment, "incapable" of understanding the complexities of this·problem due to my lack of overall electronics experience (terminology, equations, etc..)
The number of problems that would arise when attempting to·process a 15 kHz signal through a 12 bit A/D cog converter seem to be numerous and I think I'd be better off purchasing an 12 bit A/D converter...· but if someone has detailed instructions on how to accomplish this.... then we can talk!·
Basically all I comprehended from my research was:
-put capacitors on ground and positive (VDD and VSS) to filter power coming in and out (cleaner signal)
-use a resistor in line with the input signal...
Technic-R-C
Post Edited (Technic-R-C) : 10/13/2009 1:59:25 AM GMT
Here is your first hurdle.
At 12 bits, the Propeller A/D samples at about 19.6Khz. Nyquist limits you to a signal bandwidth of about 9.8Khz, so you can't practically process a 15Khz signal with it in any case.
I'm using an MCP3301 to do audio processing with the Propeller. I sample it at 80Khz, low pass filter that effective sample rate of 20Khz and use it to process 10Khz of audio bandwidth.
That part itself works quite nicely.
The MCP3301 has 13 bits of resolution. Between the oversampling and reducing the res down to 12 bits it provides very clean samples.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
I looked at the datasheet and from your remarks the MCP3301·looks like a very nice A/D converter, especially for my application.
I found one for $2.40 at $5.21 shipping at Mouser.com, pretty good deal
Thank you
Technic-R-C
Post Edited (Technic-R-C) : 10/13/2009 2:27:53 AM GMT