You 'could' by just changing the reference to the input pin, but what's going to happen is that the 'other' unused pins that are still connected are going to affect your readings. You could I guess use an analog switch of some kind to externally multiplex the fbPin in conjunction with the interested input, but unless you have more than 4 sensors you don't really gain anything in the way of an I/O advantage. With multiple ADC inputs I would go with a multi channel ADC in this case.
You should check out these new high speed, 2.7V to 5.5V ADC's that we just started to carry at Parallax...
I do this on the Propeller Backpack, using two resistors on the feedback pin, one to each input summing junction. It works just fine, but with one caveat: when you switch from one ADC input to the other by modifying CTRx, you need to let the input "soak" awhile before taking any readings. This is to allow the caps on the new summing junction to recharge to the logic threshold. The time constant for this will be 2RfbC, where C is the value of each cap to Vdd and Vss. Other than that, there should be no interaction between the two inputs, since the feedback pin is always an output, and the inputs are not otherwise connected.
Yes, that's the way I did it for 4 inputs. In the main loop I activate an input, read cnt and clck and when I come back, I determine cnt and clck again, start the next input, divide d_cnt by d_clck, so the result is independent of loop runtime and then I start over for the next channel. Computing of the value gives the next channel some time to settle.
ErNa
Comments
You 'could' by just changing the reference to the input pin, but what's going to happen is that the 'other' unused pins that are still connected are going to affect your readings. You could I guess use an analog switch of some kind to externally multiplex the fbPin in conjunction with the interested input, but unless you have more than 4 sensors you don't really gain anything in the way of an I/O advantage. With multiple ADC inputs I would go with a multi channel ADC in this case.
You should check out these new high speed, 2.7V to 5.5V ADC's that we just started to carry at Parallax...
2-Channel 12-Bit A/D Converter with SPI Serial Interface - $3.47
4-Channel 12-Bit A/D Converter with SPI Serial Interface - $4.73
8-Channel 12-Bit A/D Converter with SPI Serial Interface - $5.22
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
-Phil
ErNa
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away