I have written a driver for the AD5590 and tested it with the Arduino Uno. My code works correctly on the Uno which is a 5V system. I am now trying to make the code work with a 3.3V ESP32. With the ESP32, the ADCs return values that are double what they should be.
I am doing my development with the eval board. The eval board is configured in almost the same way for the UNO and ESP32. Here are the differences:
For the ESP32, EXT VDRIVE is connected to 3.3V via J6 and jumper LK37 is in position B so that EXT VDRIVE is connected to VDRIVE. AVDD is connected to 5V via J5 (and jumper LK35 is in position A).
For the UNO, AVDD is connected to 5V via J5. EXT VDRIVE is not connected because LK37 is in position A, thus connecting VDRIVE to AVDD.
I have verified that there is a reference for the ADCs: V_REFA is connected to V_REF1/V_REFOUT1 by placing jumper LK16 in position C. I verified that the voltage there is 2.5V. This reference is the internal DAC reference.
With both the UNO and ESP32, the DACs work and with the UNO the ADCs work. However, with the ESP32 the ADCs report a voltage that is double what it should be. For example, 2.5V is incorrectly reported as a value of 4095 instead of 2048.
I have set the ADCs to return straight binary values and configured the range to be 0 to 2*VrefA. For example, I read ADC 0 by sending the following value to the ADC: 0x8310
Any ideas what the problem is?
Thanks