MCP3002 10bit AD problem
xanadu
Posts: 3,347
I have an MCP3002 I am trying to interface with the Propeller. I cannot seem to get any output from it, currently I am just looking for a state from a pin and consistently get 0. I'm wondering if I have a bad AD, but don't have any spares to test. Any ideas?
Output (w/3.3v applied to ch1 and ch2 low)
Using this object: http://obex.parallax.com/object/119
I have changed this-
To this-
I'm also using this for inputs-
Output (w/3.3v applied to ch1 and ch2 low)
Wait Hi... 0 Wait Lo... 0 Reset Max/Min Frequency: 0Hz done in 0 samples Average: 0 average tested with 0 samples State: 0 Cur Value: 0 Max Value: 0 Min Value: 0
Using this object: http://obex.parallax.com/object/119
I have changed this-
ADC.start(Vo_p, Vn_p, Vclk_p, Vcs_p, 8, 8, 12, 1, false) ' startup the ADC driver (Vo_p and Vn_p can be the same IO pin), 8 channel ADC, ' scan all 8 channels, 12-bit ADC, mode 1 (single-ended), and using slow communication
To this-
ADC.start(Vo_p, Vn_p, Vclk_p, Vcs_p, 2, 2, 10, 1, false) ' startup the ADC driver (Vo_p and Vn_p can be the same IO pin), 8 channel ADC, ' scan all 8 channels, 12-bit ADC, mode 1 (single-ended), and using slow communication
I'm also using this for inputs-
''* Example wiring would be as follows: * ''* R1 * ''* ADC─┳──┳──input * ''* C1 R2 * ''*   * ''* R1: 10K (high impedance input is helpful, 10K should be the minimum) * ''* R2: 100K (this effectively creates a voltage divider, but also drives input to * ''* zero volts when not in use) * ''* C1: 0.01µF (10000pF is the about the maximum you would want to use. The * ''* capacitor reduces jitter or spikes but also reduces resolution). *
Comments
Must be PEBKAC