Hello all,
I am currently working on a custom PCB design that requires the use of an ADC to convert 0-12V to a digital value that can be processed by a Fx2837 MCU. The ADC I am working with is an AD4681. I am having issues with reading values correctly either due to specific timing constraints, a problem with the design, or a faulty component. I will try and provide as much info I have available to make the problem clear and welcome all feedback.
What works: I can convert 0-12V input voltage down to 0-3.3V to be measured by the ADC and have verified the input pins receive this voltage. I am able to communicate to the ADC via SPI commands, both giving instructions and reading data off of the SDO line. I have given it instructions to output the converted data measured from both inputs simultaneously via one line as a 32-bit number. I can divide the data up to two 16-bit numbers that represent the input voltage for each of the two inputs.
That's where things stop working as expected. The data is random, as if the input pins are floating. I have checked connectivity and can assume that the device is properly soldered to the board and there is no short between the differential pairs. The positive pin sees the 0-3.3V input voltage and the negative pin is connected to ground. But my data bounces around and I cannot convert the digital signal to useable code. The data is given to me in twos-compliment format and I have code that converts it accordingly. I shouldn't be measuring negative numbers regardless, but that seems to be the case 75% of the time.
What might be wrong: Based on the schematic in the datasheet, I should have put a capacitor from the negative input to ground. This seems like a noise filtering consideration and not a defect, but am open to other's interpretations. Otherwise, I don't see anything that could point to the design being the problem. Unfortunately, because it is a surface mount component and the negative input lines connect to the ground pad underneath the device, I cannot cut the trace and test a capacitor to ground. I do hope that this is not an indication of where the problem is.
The other potential risk is the timing constraint of measuring valid data. The ADC requires the CS line to be cycled to create a latency before being cycled again when reading the data off SDO. The time of converting the data internally is 190ns, but I have an innate delay of 20ms after toggling the CS line. I would need to adjust the clock frequency of the MCU in order to make it closer to 190ns, but based on the datasheet, it just seems like I need to wait 190ns before reading the converted data by issuing a dummy command to generate the necessary SCLK signal to push the data onto SDO. As long as I read the data within a frame of toggling CS, I feel like my code should be sufficient.
Clearly that is not the case though, as I receive data indicating it isn't measuring the potential difference to any degree of accuracy. It doesn't even appear to be a case of data corruption that could benefit from CRC, as there is no clear pattern between the input voltage and the random values. I have attached a snip of code that gives a little more detail as to what I am trying to accomplish.
Any help and feedback is appreciated. Beyond telling me the design requires a cap to ground on the negative terminal as that sounds like game over to me.
I am currently working on a custom PCB design that requires the use of an ADC to convert 0-12V to a digital value that can be processed by a Fx2837 MCU. The ADC I am working with is an AD4681. I am having issues with reading values correctly either due to specific timing constraints, a problem with the design, or a faulty component. I will try and provide as much info I have available to make the problem clear and welcome all feedback.
What works: I can convert 0-12V input voltage down to 0-3.3V to be measured by the ADC and have verified the input pins receive this voltage. I am able to communicate to the ADC via SPI commands, both giving instructions and reading data off of the SDO line. I have given it instructions to output the converted data measured from both inputs simultaneously via one line as a 32-bit number. I can divide the data up to two 16-bit numbers that represent the input voltage for each of the two inputs.
That's where things stop working as expected. The data is random, as if the input pins are floating. I have checked connectivity and can assume that the device is properly soldered to the board and there is no short between the differential pairs. The positive pin sees the 0-3.3V input voltage and the negative pin is connected to ground. But my data bounces around and I cannot convert the digital signal to useable code. The data is given to me in twos-compliment format and I have code that converts it accordingly. I shouldn't be measuring negative numbers regardless, but that seems to be the case 75% of the time.
What might be wrong: Based on the schematic in the datasheet, I should have put a capacitor from the negative input to ground. This seems like a noise filtering consideration and not a defect, but am open to other's interpretations. Otherwise, I don't see anything that could point to the design being the problem. Unfortunately, because it is a surface mount component and the negative input lines connect to the ground pad underneath the device, I cannot cut the trace and test a capacitor to ground. I do hope that this is not an indication of where the problem is.
The other potential risk is the timing constraint of measuring valid data. The ADC requires the CS line to be cycled to create a latency before being cycled again when reading the data off SDO. The time of converting the data internally is 190ns, but I have an innate delay of 20ms after toggling the CS line. I would need to adjust the clock frequency of the MCU in order to make it closer to 190ns, but based on the datasheet, it just seems like I need to wait 190ns before reading the converted data by issuing a dummy command to generate the necessary SCLK signal to push the data onto SDO. As long as I read the data within a frame of toggling CS, I feel like my code should be sufficient.
Clearly that is not the case though, as I receive data indicating it isn't measuring the potential difference to any degree of accuracy. It doesn't even appear to be a case of data corruption that could benefit from CRC, as there is no clear pattern between the input voltage and the random values. I have attached a snip of code that gives a little more detail as to what I am trying to accomplish.
Any help and feedback is appreciated. Beyond telling me the design requires a cap to ground on the negative terminal as that sounds like game over to me.
Attachments
-
108.1 KB Views: 19
-
420.6 KB Views: 7
-
1.8 KB Views: 6