12-bit ADC on dsPIC33F - Output format
I successfully use the channel 0 of the 12bit-ADC on a dsPIC33F. It is configured in differential mode such that AN2 is its positive input (CH0SA = 2), and AN1 is its negative input (CH0NA = 1).
That works fine as long as the output format FORM = 0 (unsigned integer). As the voltage difference may get negative, I tried using FORM = 1 (signed integer), but then the value gets completely wrong.
If I use FORM = 1 and read channels AN1 and AN2 individually (with CH0NA = 0), that works fine though. It seems as if the calculation inside the ADC gets something wrong.
Has somebody used differential mode successfully with FORM = 1? Or can somebody tell me whether that is impossible?
Is there something wrong with my understanding of 'differential' mode of the ADC?
Thanks and kind regards
Here are some results with FORM = 1, CH0NA = 1, Vcc = 2.8V, :
Voltage @ AN1 = 1.02V and voltage @ AN2 = 1.65V:
-1160 + 920
Voltage @ AN1 = 0.75V and voltage @ AN2 = 1.92
-375 + 1711
Voltage @ AN1 = 0.4V and voltage @ AN2 = 2.7
+627 + 3364