Multi-Input ADC
ErNa
Posts: 1,752
Sometime there is need to measure more than two slowly changing analog values. This obviously can be done:
There is one feedback pin which can drive as much 100 k resistors in parallel and more than one input can be used as comparator inputs. The active inputpin can be selected on the fly and after waiting some time, the selected analog input stabilizes and is not influenced by the other inputs. Following just my simple test software in Spin.
[code]
' Test MUX-AD-Converter: feedback Control Output 23, Inputs: 20, 21, 22
ADCOutPin := 23
ADCInPin := 22
DIRA[noparse][[/noparse]23]~~ ' Pin 23 Control Output
CTRA := %01001_000 << 23 + ADCOutPin << 9 + ADCInPin
FRQA := 1 ' Modus f
ModEdit: Add image of ASCII art
3.3V  1nF 150kΩ adcpin0 ────────┳──╋─────────── Analog In 100kΩ 1nF ┌──────┘  │ Vss │ │ 3.3V │  │ 1nF 150kΩ adcpin1 ─┼──────┳──╋─────────── Analog In │ 100kΩ 1nF ┣──────┘  │ Vss │ │ 3.3V │  │ 1nF 150kΩ adcpin2 ─┼──────┳──╋─────────── Analog In │ 100kΩ 1nF fbpin ─┻──────┘  Vss
There is one feedback pin which can drive as much 100 k resistors in parallel and more than one input can be used as comparator inputs. The active inputpin can be selected on the fly and after waiting some time, the selected analog input stabilizes and is not influenced by the other inputs. Following just my simple test software in Spin.
[code]
' Test MUX-AD-Converter: feedback Control Output 23, Inputs: 20, 21, 22
ADCOutPin := 23
ADCInPin := 22
DIRA[noparse][[/noparse]23]~~ ' Pin 23 Control Output
CTRA := %01001_000 << 23 + ADCOutPin << 9 + ADCInPin
FRQA := 1 ' Modus f
ModEdit: Add image of ASCII art
Comments
Post Edited (Rayman) : 4/2/2008 10:30:38 AM GMT
This gives quite stable values and the module can be integrated into a loop with varying runtime. I didn't think about to optimise the memory consumption, only try to make it working
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔