Hello,
I'm new in CC2530 and I'm facing some problems with ADC.
From the User's Manual we get:
"The digital conversion result is represented in 2s-complement form. For single-ended configurations, the
result can be expected to be positive. This is because the result is the difference between the input signal
and ground, which is always positively signed (Vconv = Vinp – Vinn, where Vinn = 0 V). The maximum
value is reached when the input signal is equal to VREF, the selected voltage reference."
So my main question is: How do I configure the single-ended mode?
I'm using AVDD reference voltage (2,5V). For V=142mV in the channel 2, I get only around 116 in the ADC (In 12 bits I'd expect twice). For V=~0V sometimes I get small negative values. This makes me believe that the ADC is, somehow, mid-scaled. Is it so?
I'm getting the adc result from:
reading = (int16) (ADCL);
reading |= (int16) (ADCH << 8);
reading >>= 4;
I'd really apreciate some fast help.
Best regards,
Jose Faria