Post Go back to editing

Second channel of AD7175-2 not converted

Hi there,

I decided to measure the internal temperature of AD7175-2 chip on the second channel. The chip is initialized to measure two channels:

  • Channel0: Voltage between AIN0+ and AIN0- (Command 0x10 0x8001)
  • Channel1: Voltage on internal temperature sensor. (Command 0x11 0x8232)
  • Channel3 and 4 are disabled.
  • Both channels uses the Setup0 register (Command: 0x20 0x0320)

I use the Single Conversion mode. The data sheet says on page 41:

…As soon as the conversion is available, the RDY output goes low. The ADC then selects the next channel and begins a conversion…

But there is no second conversion. The channel0 is converted but even the application waits almost three times more (158µs ) than the first conversion time (41µs) the DOUT/RDY pin stays high and never goes low. What do I do wrong?

Traces:

  • Yellow: Chip select of AD7175-2 
  • Green: Data input of AD7175-2 
  • Pink: Data output/ Data Ready of AD7175-2 
  • Blue: Serial clock.

My other notice is. On page 48. Internal Temperature sensor chapter the nominal sensitivity in the text is 470µV/K but in the temperature calculation it is 477µV/K. Which is right? The manual says the temperature in °C = (Conversion Result / 477µV) – 273.15. But the Conversion Result is not the code I read from the converter. First it must be converted to voltage, is not it? Using “Conversion Result” is very confusing.


Thank you for your help!
Best regards,
Louis



Wrong part number in title. I am sorry...
[edited by: Louie88 at 7:44 AM (GMT -5) on 6 Jan 2022]
  • Hi Louis, 

    First may I asked you to update the title of this thread so that it will reflect to the correct part number similar to some of the post in the thread. Providing the correct part number/tag will notify the responsible engineer handling this product. 

    With regards to your query, May I know also the flow of your communication? For example have you last write the ADCMODE register to initiate the single conversion I meant before writing to CH1 register? The 41us seems correct timing for a very fist conversion so we just have to make sure that the second channel was enabled first before initiating conversion. 

    For the temp sensor the correct sensitivity is 477uV/K. And the conversion result must be converted to voltage as the denominator is also in uV.  

    Thanks,

    Jellenie

  • Hi Jellenie,

    I am sorry for the scrambled part number. I fixed that.

    Here is my initialization code:

    	// Reset AD71772-2
    	ADCResetCommand();
    	// 10ms delay
    	SysTickDelay(10);	
    
    	// Send Channel 0 command (AIN0 - AIN1)
     	ADCWriteChannel0Register();
    	// Send Setup0 command
    	ADCWriteSetup0Register();
    	// Send Filter Confiuration0 command
    	ADCWriteFilterConfig0Register();
    
    
    #ifdef READ_ADC_TEMPERATURE
     	// Send Channel 1 command (Temperature sensor+ and - Temperature sensor-
     	ADCWriteChannel1Register();
     	// Channel uses SETUP1
     	ADCWriteSetup1Register();
     	// SETUP1 FILTER1
     	ADCWriteFilterConfig1Register();
    #endif
    
    	// Set ADC working mode to Single Conversion Mode
    	ADCWriteAdcModeRegister(ADC_MODE_SINGLE);
    
    	// Interface mode register
    	ADCWriteInterfaceModeRegister();
    
    	// Read gain
    	adcControl.gain0 = ADCReadGain0Register();
    	if (adcControl.gain0 < 2.3 || adcControl.gain0 > 2.7)
    		adcControl.gain0 = 2.5;
    
    	// Read offset
    	adcControl.offset0 = ADCReadOffset0Register();
     	if (adcControl.offset0 < -8192 || adcControl.offset0 > 8192)
     		adcControl.offset0 = 0;
    

    Thanks,

    Louis

  • Hi Jellenie,

    And here is how the Single Conversion works. I have a sampling timer. When it times out then I send the start Single Conversion command:

    0x01 0x8010

    After sending the start Single Conversion command, when I detect the FIRST falling edge of DOUT/RDY pin then I send the Read Data Register command (0x44). After receiving the 3-bytes conversion result of the first channel I wait again for the falling edge of DOUT/RDY pin again. If it is detected (but it never happens) then I send the Read Data Register command (0x44) and read 3-bytes conversion result of the second channel.

    Thanks for your help.
    Louis

  • Hi Louis, 

    Is it possible for you to zoom in the scope shot? For the first channel conversion have you been able to read the correct input value? 

    Usually when DOUT/RDY stops pulsing at any time and it stays high or low, this could indicates that the serial interface has become asynchronous (incorrect number of SCLK pulses, glitches on the SCLK line). Ensure that the correct number of SCLK pulses are being used for each read/write operation. 

    Have you also tried to read back other registers for example the channel register content? This is just to ensure that you enabled it properly or configure the device properly.

    Thanks,

    Jellenie

  • Hi Jellenie,


    I can’t send you much better screenshot, because myTektronix scope (TDS2004B) works up to 60MHz only and has 320x240 pixels screen. Currently I do not have better scope. However here is a screenshot when the 0x01 0x8010 start single conversion is sent. The zoomed picture shows when the first byte (0x01) is sent:

    Where:

    • Yellow: CS
    • Green: DIN
    • Pink: DOUT/RDY
    • Blue: SLCK

    I send the correct number of SLCK (8 pulses/byte). I can read Gain and Offset register data, I read back Channel0 and Channel1 settings. No problem at all. Even - because the software uses conditional compiling - I can disable reading the temperature sensor and I use Channel0 only to measure the electrode voltage. This works perfect. I have the input sine wave samples, the same RMS voltage what I measure on electrode with DVM.

    The issue happens when I initialize and enable the 2nd channel to measure the temperature. Now the temperature has own Setup1 and Filter1 registers and I use the Setup=1 in Config1 register.

    Even, I enabled to send the 4th data byte (DATA_STAT) and it never shows any error. It is always 0x00. I checked whether the 4th byte is really the DATA_STAT byte: I incremented the input voltage so the ADC has over and under range error which immediately appears in DATA_STAT byte.


    I have no idea why does not the 2nd channel convert.
    Thanks for your help! I count on it.

    Louie

    Hi,

    I decreased the SPI clock to 2.5MHz and I got better waveform. This is when RDY goes down and the CPU sends the 0x44, read data register command. Some part of the answer is on the picture.

    On this picture the full answer is shown:

    I do not see any problem with the clock and data. Do you?

    The problem is that I do not have channel1 conversion ready. DRY does not go down. The CS is 175usec long. This is more than 4 conversion time (4 x 40us).

    Thanks,

    Louis

  • Hi Louis, 

    This is also puzzling me, I'll try to review again the above info and get back to you if I find anything els.

    But any chance you might have been mis-enabled the Alternate synchronization mode (ALT_SYNC bit) in the Interface register? 

    Thanks,

    Jellenie

  • Hi Jellenie,

    I appreciate very much your efforts to help solving this issue!

    To be honest the IFMODE register was not initialized (accidentally). However, it’s default value = 0x0000, so the ALT_SYNC = 0 after power on reset. I added an AD7175WriteInterfaceModeRegister() function which writes 0x0000 into IFMODE register, but as I expected it did not solve the problem.

    My original AD7175 driver was interrupt driven. In the last few days, I rewrote the driver without using interrupts. It did not solve the multi-channel problem.


    Best regards,
    Louis

  • Hi Louis, 

    I'm not sure if you have tried this. But have you tried switching to continuous conversion mode? For example, in continuous conversion mode, stop reading the data register and just monitor the DRDY pin when /CS is low. Does it also stop pulsing anytime?

    We can try to isolate some of the code/steps and add them one by one for debugging.

    For example upon power up, do not attempt to write or read to any of the registers and just pull the /CS low do you see DRDY pin pulsing at default ODR (250ksps)?

    Now just try to change the ODR to 125ksps for example by writing to Filter register only, all other registers are default. Then again, do not attempt to read the data register and just pull the /CS monitor the DRDY pin. Do you see it now pulsing at the new selected ODR (125ksps)? 

    If the above 2 steps work correctly. Now using the 125ksps ODR try now to enable 1 additional channel by writing to channel 1 register for example. Then again, do not attempt to read the data register and just pull the /CS monitor the DRDY pin. Do you see it now pulsing at 41.45ksps? 

    Thanks,

    Jellenie

  • Hi Jellenie!
    Thank you for the ideas but meanwhile I “double thought” or AD7175 handler and wI made fundamental changes, without using the (non-working) multi-channel mode this time.

    1. I don’t really need to know the internal temperature for every conversion results. I need to know the internal temperature once a second or rarely. Reading the temperature continuously would double the conversion time and communication time.
    2. I gave up the interrupt-based SPI control. I just simply use SPI_Write(byte *buffer, byte count) and SPI_Read(byte *buffer, byte count). These functions block the CPU for a short time but makes controlling the AD7175 much easier.
    3.  Also, instead of watching the DOU/RDY pin state I read status register AD7175. Once the bit7=0 then I can read the conversion results (I read the status register 8x max, then give it up)

    4. I initialize the channel 0 for converting input voltage but I also initialize the channel 1 to convert the temperature. During POR the channel 0 is enabled but channel 1 is disabled, AD7175 will convert the input voltage only.
    5. Once a complete period of input sine wave is converted (1024 samples) I insert a convert the temperature command.  I disable channel 0 (input voltage), I enable the channel 1 (temperature) and start a single conversion. When the conversion is complete the I read the data register which contains the temperature. I save the temperature code and disable channel 1(temperature) and re-enable channel0 (input voltage) and AD7175 continues to convert the next 1024 input voltage samples. This trick works perfect.

    I appreciate your help and tank you the fantastic support. I leave the multi-channel conversion for others. But I think you are right: the multi-reading works only in continuous conversion mode

    .
    Many thanks!
    Best regards,
    Louis

    PS: You can close this ticket

  • Hi Louis, 

    Good to hear you find a possible workaround. However, I don't think we really found out the root cause of the issue. Actually I did not say that multichannel only works on continuous conversion, it also can work in single conversion mode. I am just suggested the above procedure for easy debugging and see when exactly it stop converting. And honestly I haven't experienced this issue with this part so there is just something in the system that may possibly cause this. I won't force you to figure it out especially if you do not want to to be stuck in your development process. But in the future or in case you still wanted to figure out the above procedure might help. 

    Thanks,

    Jellenie