I am programming a library for the ADAQ7768-1 (together with the Mikroe DAQ click board) for use with an Arduino using SPI communication. I'm able to read the several provided registers. But I'm wondering about converting the raw data to the actual voltage. The datasheet provides the following formula:
Where Offset and Gain are 24-bit, signed, two's complement values.
Using a reference voltage of 4.096 V (provided by the DAQ click board), and the standard gain and offset of 0x555555 (default as per the datasheet), voltage under ~3.7 V give negative data values. How should I read these values? It's not clear from the data sheet.
Moreover, in the DAQ click example code (search for "DAQ click" on this page), they use a simplified formula that doesn't even involve nor the offset nor the Vref:
voltage = ( ( ( ctx->gain ) / ( DAQ_RESOLUTION ) ) * adc_data );