I am facing some issues with the output values from an ADS7822.
The ADC is adequately bypassed and wired up, as follows. Please note that the inverted pins on the schematic are not an issue. I routed the proper wires between the ADC and the MCU.
The ADC is driven by a Teensy 3.6. It should be noted that I am using level shifters at the digital pins. The SPI speed is set at 100 KHz (with SPI mode 0) and has been tested at up to 1MHz, where the signal integrity is still good (due to the speed limitations from the level shifters).
The decoded SPI output is the following:
This output value is wrong since the voltage I am feeding to the ADC's input is a fixed 3.3V which should correspond to 0xA8E. The decoded value shown in the image matches perfectly with the
Serial.print debugging outputs from my implemented code. The SPI capture portion of my code is the following. Please ignore the dumb comments and extra lines :P. I successfully tested both techniques for forming the 12-bit word through bit shifting.
To me, the timings are in line with those specified by the datasheet:
I have tried with different input voltages and the decoded output voltage is always the digital equivalent between 4.1v and 4.6V (0xCFF is approx. 4.061V).
Any ideas on what I am missing or doing wrong?
I can elaborate on my explanation if need be.
EDIT: The Vref pin is connected to an LM4040-5 precision voltage reference, thus 5.0V is the voltage reference.
[EDIT 2] I want to clarify that the LM4040-5 is fed by an additional 15V rail that I forgot to edit in the schematic shown here.