I am using the adc_soc example to convert an analog voltage signal to a digital one. The pins that the example uses are ADCINA (J1.6) and ADCINA2 (J1.8). I first connected
J1.6 : 3.3 V pin
J1.8 : GND pin
and received very nice digital values of ~4096 and 0, respectively. What is important is that each of these functions individually. In other words, if I disconnect pin J1.8, for example, I still have a reading of 4096 V from J1.6.
However, what I really want to do is measure the voltage signal from a battery pack (which is also divided by a voltage divider) which is equal to ~2.88 V. So, I connected
J1.6 : 2.88 V
J1.8 : analog GND
and received digital values of ~3200 and ~250, respectively. Moreover, when I measure these pins individually these values change to ~1900 and ~1800.
I realize that I need a good reference value (or I need to incorporate this into my code), but I am uncertain how I should proceed. I read that I need to do something with VREFLO and VREFHI, but that there are no pins designated for VREFLO and VREFHI. How should I set these reference values?