Question on AN008 Sigma/Delta ADC
RS_Jim
Posts: 1,764
in Propeller 1
On page 9 of the ApNote it talks about using a common output pin with multiple input pins by switching the source for CTRA. It goes on to say "The one major caveat is that, after switching inputs, it is necessary to delay long enough before taking the first reading for the summing junction caps on the new input to recharge to the input pin's logic threshold." Any idea what "long enough" is?
I have two ADC running with a common output pin, but I am getting sufficient cross talk so that both devices are showing that same reading.
Jim
I have two ADC running with a common output pin, but I am getting sufficient cross talk so that both devices are showing that same reading.
Jim
Comments
You mean 100% cross talk ? Sounds like something is amiss.
The active node will be at 50% of Vcc, and the inactive node will be at some stable voltage, other than 50%, determined by the IP voltage differences.
If both Vin are (almost) the same, the settling time will be short.
If one is at Max+, and the other at Min-, then you need to slew 50% of Vcc
- Allowing a delay of R//*C will give you a little margin, for worst case differences.
If you have a spare Timer, you could run two simultaneous ADCs
The Analog device is a Parallax joystick fed with 3.3V from the Quickstart Board.With the joystick centered, both inputs are about 1.7 V. If I move the joystick to the limit in one direction, I get a reading of 0 and at the other it is 512. (512 is the max count value for the routine) When centered, both outputs are similar 1 at 256 the other at 307. when I move the joystick, to extreme both outputs end up at either 512 or 0. So I was wondering if my problem was a hardware issue or software. The AP note says you can use one output pin from the counter connected back to the inputs with 100K resisors for each input.
I was trying to make Sigma/Delta work as I had the resistors and the caps were readily available. To use a second timer would require using another output pin which I was trying to avoid. I may be forced to move to a hardware solution such as thhe MCP3208.
Being to do it all with S/D would allow me to get all the A/D I wanted without additional hardware.
Jim
I suspect the problems you are having are hardware, and related to the layout of the components of the s/d. Having the components close to the pins is critical, as is the physical location of the common output pin in relation to the input pins.
Note that the single input s/d circuit in the ap note suggests using corner pins, and the dual circuit has 3 consecutive pins with the output in the center of the trio. For best results a grounded guard band on the pcb around each input would help.
Getting good results from Sigma/Delta adc's requires careful component layout, which is very difficult to achieve with typical pad per hole prototyping boards.
That is what I was suspecting in the timing. How much delay do you use for each switch of inputs?
Jim
Thanks
Jim
I attach the diagram from AN008 for reference. I'll +1 the above comments that every single component there needs to be close to the associated pins, and that includes the capacitor connections to Vss and Vdd. Within a few tenths of an inch for best results. It sounds like the crosstalk is quite strong, or the scale factor is off. You mentioned that the values are 256 and 307 when both are at the center position. What happens when you move them slightly off the center position? It might help to show your code.
My code is the code in the ap note with a loop added to pick up the additional input and provide an additional output for storing the results. I can easily add a 2MS delay by introducing a wait count between calls to the ADC subroutine after switching the input to the CTRA.
Thanks for all the feedback
Jim
IIRC I posted the code on the forum so I will try and dig it out. For my purpose it wasn't that critical for the components to be quite as close to the pins (a few tenths of an inch). I was impressed with how well it worked.
http://forums.parallax.com/discussion/132150/4-or-5-wire-touch-screen-driver-using-a-propeller-instead-of-a-specialised-ic
Check the wipers with a voltmeter, and see if the ADC is roughly reporting what the wiper voltages are.
To simply avoid any SW-Mux cross talk effects , for checking, you can run just one channel at a time.
ie compile ChA, download and plot some points, then compile ChB only, and plot some points.
If the effect remains, you have a hardware issue.
Thanks for all the input, back to the drawing board! Maybe I can work a deal with Duane to get 1 of his new 3208 boards.
Jim
ie measure the actual resistor values, and check both the Wiper voltage, and the ADC node at the Prop Pin.
In charge balance mode, the Prop pin voltage will be a plateau of ~ 50% Vcc, but outside the range (0% and 100% readings), it can no longer maintain balance, and it will move away from ~50%.
If you have wildly incorrect resistor values, for example, you can get similar to your results.
Post a table of 5~8 values of Wiper Voltage and ADC Pin voltage for 20~12.5% steps
You can also test with no Joystick, just 2 or 3 resistors :
eg With a feedback resistor of 100k, a total series in R of 200k should give ~ 25% and 75% at Vcc/Gnd drive.
-Phil
I am going to attempt to attach a zip of the code and a photo of the wiring.
Voltages measured at the joystick are 1.66V and 1.68 respectively Mid Stick.
1 direction on stick 0.03 to 3.08 and 0.07 to 3.3 in the other direction
Jim