Smartpin adc value question
CRST1
Posts: 103
in Propeller 2
I just got the new replacement eval board, thank you very much again Chip and Ken, and I was testing the analog smartpin inputs. This time with the 3.3 and gnd pins on the eval board!! The first two pins were about 700 at 0 volts and 3600 at 3.3 volts, both about the same I think within 1 or 2. I tried another and it was about 100 higher with the same voltage. A third and fourth were off a little more each. Is this normal and each pin will have to be adjusted in the program to make them all equal? For now I just added or subtracted to equalize them and set 0 volts equal to 0 digital reading.
Is this the correct way or is there a better way to do it?
Thanks
Is this the correct way or is there a better way to do it?
Thanks
Comments
Select config details are in ADC section here - https://forums.parallax.com/discussion/comment/1452036/#Comment_1452036
It was suggested that instrumentation use would benefit from tying the pin-pairs together and alternating the sampling between signal and calibration. While one pin is reading the signal the other pin is being recalibrated.
Just wanted to make sure it was normal.
Am I just reading this wrong or can you somehow switch the mode to read GIO, VIO or actual pin voltage in the code?
Some of this may sink in to this old head sometime.
Yes, the WRPIN mode number contains the input selection in the %P bits.
As Chip indicates, SINC2 mode provides highest resolution and it takes at least three "decimation" samples to settle.
EDIT: Err, SINC3 mode is highest resolution. Just use the same conversion mode for the calibration as you're using for signal sampling.
I tookj the example from the google document and modified it for 14 instead of 8 bits resolution. It works but I had to place a zerox instruction after the shift. Without the zerox I sometimes get garbage in the bits above 13. I'm using the same waitse1 as in the example and my loop is quite short so I don't think I get overflows due to missed events.