Analog to Digital ?
Paul
Posts: 263
I'm looking for examples for sigma-delta ADC written in assembly or SPIN.
I need to monitor some 60-400 hz signals. Thanks.
Paul
I need to monitor some 60-400 hz signals. Thanks.
Paul
Comments
There are two wiring versions. The best uses 3 pins to draw a higher degree of accuracy, but in many cases the two pin configuration is quite adequate. As I recall, one has 12 bit resolution while the other has 8 bit resolution. Since 7bits will provide over 1000 steps of resolution, many tasks have Analog to Digital converters that are overkill.
Propellor's 160mhz also offers sampling more frequently than a lot of ADC chips.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Bergamot, DAC is possible in straight Spin, I have posted the code to the forums, use http://search.parallax.com·to find it. ADC must use assembly because the timing in which the values are read is critical.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
In many cases, greater factors of ten really just look good on paper.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
I tried adc with my selfmade propeller circuit setup, but it did not work (due to too long wire connections?).
Therefore I tried it as pure spin to slow it down. And now it works - really slow but surprisingly accurate.
Christof
Christof
the voltage at the capacitor and input pin 8 is held near 3.3Volts/2 by the method. The current into the capacitor is I_Input=(U_Input-3.3/2)/R_Input and is to be compensated by the same current through R_feedback. I_feedback=3.3/2/R_Feedback, when the pin is switched to low. So, if the voltage to be measured is greater than 3.3V, R_Input has to be greater than R_Feedback and this gives the relation of the resistors.
Normally the input resistor is wanted to be as high as possible to give no influence to the voltage measured. I don't know the input current into the input pin, which gives an error in the method, because this current is assumed to be zero. This input current would therefore be a limit for the values of the resistors.
I used a normal 1kOhm cheap resistor and had the opportunity to measure 962Ohms as actual value.
Using a 10kohm linear pot, to get a reasonable range of readings, I had to use the 14 bit mode, throw away the lowest five bits, and subtract 141;
that is
value/32-141
and then I got a range between 1/2 and 351/352 - which is more than good enough for my application; I just needed a proportional input based on a knob I turn.
I'll have to pick up a 10megohm pot, that should give me better range and control with this a/d method and 150k input resistor.
Hmmm...
I can't see any reason why I can't put a 4051 8:1 analog mux in front of it... [noparse]:)[/noparse] then 5 pins will give me 8 analog inputs (or put two muxes on, 4 bits to select channel and get 16 analog channels in)
Try·isolating·those excess holes for your ADC circuit and populate only those which are closest. Also try to double up by placing two leads through 1 hole, using a pair of needlenose to crimp the leads a bit ussually works.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
The resistor is right at the pins, and the capacitors are soldered right to the bridging resistor, and out of the junction comes the 150k resistor...
The problem I think is really due to the .5" long tinned strip for every pin of the prop on the proto board.
Hmm... +-10 counts is (roughly) 4 bits off, still, thats two bits better than my result.
I'm actually considering making a PCB, and dedicating a couple of pins to an A/D circuit. I will however be dissapointed if I end up with four unusable bits. I'm used to the LSB being unreliable, but above that is less than desirable.
On the other hand, its pretty amazing to do such a/d without dedicated a/d hardware [noparse]:)[/noparse]
Now if Chip would only incorporate my upgrade suggestions to the shift registers, we could talk to off-board SPI A/D's at 640MBPS with the next prop.
If you do design a board, avoid curvatures of the traces in the critical region and keep the unresistored side of the feedback pin away from the feed-in (ideally by not using adjacent I/O pins) to minimize cross-talk.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 12/13/2006 7:14:02 AM GMT
The fact is, what I've got on the proto board is "good enough" for my current need - a pots that can be read to provide proportional positioning information; and by giving up some unneeded sampling speed, and filtering the signal (either in software or with a capacitor - or both) I can get as much precision as I need... I just have to give up on high sample speeds.
What I'm thinking of doing is using an 4051 analog mux to "front end" to two pins, so I get 8 channels of input at the cost of five pins. (or sixteen channels for six pins). I think I can get a nice reliable 8 bits of data and still get about 1000 samples per sec on each channel, which is still plenty for my current needs.
If I do lay out a board, I was thinking of using P23 and P27 for A/D, as P23 is nice and close to both Vss and Vcc for the 1nF caps; and P27 is on the other side of the TV d/a network (hmm maybe not a good idea... could be a source of high frequency crosstalk)
Or maybe P20,21,22 for the address lines for a MUX, with P19 and P23 for the A/D.
The only problem with the propeller is that I don't have as much time to work with it as I'd like! I can only sneak in an hour or so a day, and maybe four on the weekend :-(
(By Px I meant PortAx...)
I'm a new user of the propeller and interested about the ADC capabilities of the chip. I think chip's capabilities are impressive, and I'm very interested in knowing some things about the design you've done. Now I'm thinking about a project i've in mind, and have some questions:
In ADC:
Which are the adquisition, numerical conversion and temporization methods you use?
Thanks a lot, and excuse me for my poor english
It's not recommended to use adjacent pins for this procedure.
If I use pins P0/P2 for one ADC, can I then use P1/P3 for another ADC-conversion at the same time?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Well, since I'm considering using 4-to-1 analog multiplexers/switches to reduce the number of Propeller I/O-pins tied up with ADC circuitry, I suppose I could use the other pins for control signals.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.