Post Go back to editing

AD7793 output clamped to all zeros

Hey guys. 

I'm trying to include analog devices CN0326  pH-measuring circuit in an already existing measuring circuit controlled by an MSP430. 
For now, I have removed the isolator (ADum5401) because it rendered my LED display in an unpowered state. But this shouldnt affect any signals, since it only isolates between two digital areas. 

Anyhow, the problem at hand is, that the adc only outputs zeroes. 
I have solid SPI communication with the chip, and I can update and read from registers without any issues. I'm running on a very low bus-speed just to make sure my problems aren't SPI related (allthough I haven't ruled that out 100% yet). 

I start my software like so: 

Read ID register (I get the correct value) 

Internal fullscale calibration 

Internal zeroscale calibration

Set the mode register (Idle mode, 64kHz internal clk and 4.17Hz update rate). 

Set the config register (bipolar, Gain 1, buffered mode, ch1)   

I read both mode and config register back, and the correct values are stored. 

Then a lot of other stuff happens (regarding the other circuit) and when its time to convert, I change the mode reg to a single conversion, the config register to the fitting channel (Ch1 for pH, Ch2 for temperature). 

I'm supposed to measure ph in a -420 mV to 420mV span, but right now, I have tried every kind of voltage and configuration and I still can't get a conversion. 

I might not have configured it correctly even once. At this point I kinda blinded myself by trying so many different things. 

So for a +-420 mV range, how should i configure the adc with bias voltages, references etc etc. 

If you need any more info, please let me know. 

  • Hi,

    Circuit diagram of your entire system is also needed to check whether there is something wrong with hardware setup. CN0326 evaluation board was designed to have an external bias voltage of 1.05V and uses it also as the external reference voltage for the +/-490mV signal from PH probe. Thus, you don't need to enable the internal bias voltage and you have to configure the ADC with external reference in the configuration register. The PH sensor also use channel 0 so you have to select channel 0. May I know exactly the value of your configuration register?

    If you think you have configured the ADC with the above details and you still not getting data conversions. Can you stop reading back the conversions, set the ADC in continuous conversion and just monitor the DOUT/RDY pin to determine if it is pulsing at the selected output data rate? Please use OSC to monitor the DOUT/RDY pin as well as the SPI interface and show the waveform to us for further analysis. 



  • Hi Jelelnie 

    Thanks for your reply. 

    Unfortunately, I can't show you circuit diagrams as they will reveal sensitive company information, and I haven't got authority to do that. 
    What I can tell you is, that through a header with SPI signals and powersupply, the CN0326 circuit is connected through the J2 PMOD block like so: 

    CS_N - Connected to the MSP430 port 1 through a 3-to-8 line decoder (74HC138). 

    DIN -    Connected directly to the MSP430. 
    DOUT - Same as above. 

    Sclk    - Same as above. 

    Rcout - not connected. 

    Gnd / vcc - connected to the 3V digital voltage as every other chip in the entire circuit. 

    Note: On the SPI bus there is also connected a AD7718, two isolators (ADuM1310) before 4-20mA outputs for HART communication and lastly, the eeprom. 

    As far as I understand, the 1.05V for bias and reference is generated with the excitation current on IOUT2 (210uA +- 5-10%) and the 5k precision resister R1. Although that resister is a DNI, so I'm not sure how that works.. 

    CH0? I'm fairly sure that the AD has no such thing as a CH0. Not from the datasheet that is. Unless you declare +-AIN1 as CH0. 

    As of right now, my configuration register is set to 0x0010

    I will try the continous conversion you suggested and get back to you asap. 


  • Hi again Jelelnie 

    So, now I've put it in contineous conversion mode, and I've disabled all read commands (except 2). 
    I still reset after power on, do an internal full/zero calibration and set the io reg for 210uA. 

    I have also disabled all of the functions that use the SPI bus, except for a few eeprom write/reads that i have to use. 
    And yet, I still get nothing. But it seems like I'm not getting any conversion at all. 

    Channel 1 on the scope is the SPI clk, and channel 2 is the DOUT/RDY from the adc. The clk line has a few events here and there, but that is the eeprom functions mention above. DOUT/RDY on the other hand, never ever goes low. Thus, im never getting a conversion. And I have no idea why. 

  • Hi,

    Do you have any RTD connected to P1? The DNI resistor R1 is a replacement to RTD that needs to be populated if your application doesn't require a temperature compensation. Open wire RTD or R1 will not generate a voltage reference to REFIN+ and REFIN- pins due to open circuit connections, thus the ADC will no longer have a valid reference input which may results the ADC conversion to clamped to all 0s or 1s. The board is recommended to work with an RTD input.



  • Hi again. 

    No, I don't have an RTD connected. But I have inserted a 5k precision resistor on R1 and I have tried to apply a fixed voltage to REFIN +/-. And yet, i still haven't had any conversions. The test that resultet in the picture above was with a 1.05V input to REFIN+ and AIN-, and a ~2V input to AIN+. 


  • Hi,

    May I know if you mean AIN1+ as AIN+ with 2V input (with respect to what?) and AIN1- as AIN- with 1.05V bias (with respect to GND)? Usually, the ADC conversion clamps to all 0s or all 1s if you have no or invalid reference, over range and under range voltage. Can you probe the following to check the voltage level at each input.

    AIN1(+) to GND

    AIN1(+) to AIN1(-)

    AIN1(-) to GND

    REFIN(+) to REFIN(-)

    AIN2(+) to AIN2(-)

    AIN2(-) to GND

    AVDD to GND



  • Yeah sorry about that. Didnt get the '1' included. My previous mentions of AIN +/- are AIN1+ and AIN1-.

    Measured values:

    AIN1(+) to GND  = 1.542V

    AIN1(+) to AIN1(-) = 0.480V

    AIN1(-) to GND = 1.062V

    REFIN(+) to REFIN(-) = 1.062V

    AIN2(+) to AIN2(-) = 1.876V

    AIN2(-) to GND = 1.062V

    AVDD to GND = 2.94V  

  • Hi,

    It seems that we don't have any issue on the analog input voltage. When you checked the DOUT/RDY, did you pulled the CS low? Looking at the communication, it seems okay since you have mentioned that you can read and write correctly to a certain register right? In continuous conversion mode, can you change the output data rate and see if the DOUT/RDY signal is pulsing at the new selected data rate? Have you tried to use the board with its dedicated controller and software?



  • Hi again. 

    I believe I pulled CS low, yes. And yes, i can read back the exact values i put in X register. Aswell as reading the right ID. 

    Unfortunately i havent got the controller, only the frontend. 

    I placed the ad in continuous mode in main, and in the loop I hardcoded the control of CS with a delay to give clear signals. The following came out: 

    The first picture is CS on probe 1 and DOUT/RDY on probe 2. This is at 4.17Hz conversion rate.

    The second picutre is the same, except this time with 50Hz conversion rate. 

    The pulses visibly change without a doubt, but there a spikes / blanks that I can't explain. The loop only calls a few eeprom functions, but that only explain irradical behavior when CS is low. Other than that, there are calculations and display routines and the hardcoded CS handling. Thats it. 

    In my setup I only need to run single conversion about once every second. So i tried to configure some tests for that. 

    The following shows the exact same setup as before, only this time the convertion function is called in the loop and not in main. Thus it is called once every second. I originally thought i had the handling on CS secured, but now I'm not so sure. In the following pictures probe channel 2 is always DOUT/RDY!! : 

    (1).The picture shows CS on probe 1. It looks quite similar to the first picture from continuous conversion, there is only pulse. Which makes sense. In this routine there is a delay (2.5 mil clk cycles) to ensure proper signals. After the delay i read the data register. I'm not sure i can make sense of the DOUT signals. I tried to look at the corresponding CLK and it showed nothing similar to 3x8 CLK signals. It looks like I'm not reading properly from the data register, but I should be, since I use the same function to read fx the mode register. The address and number of bytes are just different. 

    (2) The two pictures above show a read of the status register, AFTER a conversion is done. Again, I have a long delay to make sure of this, and I also confirmed with the scope that DOUT goes low accordingly. The output of the status register gives me a value of 72, or 0x68 which equals a high error flag. 

    And we just made sure the analog values were usable. I have no idea what to make from this. What is causing my error? 

    (3) The 2 pictures above show the exact same setup as in (2), except here, I have no delay of 2.5 mil cycles. First picture shows DOUT and CLK, second one shows DOUT  and DIN. The CS acts just like before. And this is where I'm really confused. The first CLK pulses are 32 pulses, which suggests a data register read of all 1's. However, the corresponding signal on DIN is not equal to 0x58 and the read value I show on my display is 0.0000. 

    I hope this gives you some more info to work with.

    If you need anymore tests done, could you please suggest several things for me to try out?
    If it is one response a day from each of us, I prefer them to be long and full of info. Otherwise it's too much downtime for me.

    Really appreciate your help. Thanks!  

  • Hi,

    For the first two set of pictures, the DRDY pin looks like pulsing at the correct output data rate. However, there are spaces shows that it doesn't pulse for a few times. If DRDY stops pulsing at any time, this indicates that the serial interface becomes asynchronous or it indicates that incorrect data has been written to the device (incorrect number of SCLK pulses, glitches on the SCLK line) or the device may be seeing noise in the SPI lines. For the second picture, you mentioned that you have used single conversion mode, in singe conversion mode the ADC performs single conversion, DRDY goes low and the ADC returns to power down mode. The on-chip oscillator requires 1 ms to power up. You are timing out the reading of the conversion, it is best to use the DRDY pin to monitor the conversions and then you can read the conversion once it goes low. For the scope shot reading the status register, May I know the label of the signals? The status register is only an 8 bit register, your clock cycles looks like too many for an 8 bit data. For the last set of pictures, I don't get the values written on the DIN as well as the number of SCLK pulses. To read a conversion, you should write 0x58 and then apply 24 clock cycles.