Post Go back to editing

AD5941 OCP and AFE Switch Configuration (LPTIA)

Thread Summary

The user seeks to perform potentiometric measurements (Open Circuit Potentiometry, OCP) using the AD5941 AFE on a custom board, requiring high input impedance. The final answer suggests using the LPTIA op-amp with specific switch configurations (SW15, SW8, SW5, SW9) to avoid biasing the reference electrode (RE0) and ensure a high-impedance path. The user is concerned about the clarity of the switch configurations and the lack of access to RC0_0/1 pins, as suggested in previous threads.
AI Generated Content
Category: Datasheet/Specs
Product Number: AD5941

Hi! I would like to ask a few questions regarding the AD5941 AFE regarding the answers provided by in the following Q&As, since I am not 100% understanding the explanations and subsequent AFE states:

 AD5941 Potentiometry Basic Example and OCP Basic Example 

I have followed all your answers regarding this Potentiometry/OCP topic. However, If the normal configuration for the switches is as depicted in Figure 23 of Page 38, as  showed:

I don't really get why

   said:
- SW6 connects -ve input of PA to +ve input of LPTIA

as in the figure SW6 is shorting towards the LPDAC output rail instead, nor

 said:
- CE0 is shorted to RE0.

since neither SW2 nor SW10 are closed, for instance.


 AD5940 open circuit potentiometry

 


 said:
You may disconnect SW7 from Rload and connect SW7 to feedback path,

and give the input to RC0_0.

This way, Rload doesn't come into picture.
 


 If I don't have access to any RC0_0/1/2 pins in my design, could I obtain the same result by using SE0 pin and closing SW1, SW7 (and SW0 if needed)?


Thank you very much for your helpful replies and your kind attention!

  • Hi  ,

    We will look into this. I will contact the product owner and get back to you.

    Regards,

    JC

  • Hi Andriandreo,

    It looks like the thread you referenced is hard to follow now so instead of going back to that thread, can you summarize what you are trying to do with the AD5940 and maybe we can help you with the configuration?

    There is also a summary of different applications that the AD5940 supports in this document: AN-1563 (Rev. 0) (analog.com) Maybe we can start with one application example from this document. 

    regards,

    Mark

  • Sure! Let me clarify myself.

    OBJECTIVE

    I want to program a setup for potentiometric measurements (Open Circuit Potentiometry) using the AD5941 AFE on a custom board (NOT the EVAL board).

    AVAILABILITY

    In my custom board, I have access to: AIN0-AIN4; RE0, CE0, DE0, SE0; and AFE1-AFE4 pins of the AD5941 chip.

    BACKGROUND

    As a test, I am able to perform accurate voltage measurements of the output of a voltage divider from a 9V battery: 0.xx to 1V range as AFE input using AIN0-AIN4 and/or SE0 pins as inputs of the ADC MUX.

    REQUISITES

    However, I need to connect sensor with high impedance to do the measurements in a working electrode (WE) vs. reference electrode (RE) way, no bias voltage supplied. Thus, I would need as much input impedance in the AFE inputs as possible. I tried the same scheme mentioned in the background and it simply did not work.

    PREVIOUSLY SUGGESTED SOLUTIONS

    As I mentioned in my first post,  suggested in  AD5940 open circuit potentiometry using the RC0 pin while closing SW7 and SW10 to have an input to the LPTIA op-amp. However, I cannot access to those pins in my setup (RC0_0 and RC0_1 are the two terminals of C_TIA as suggested by the datasheet and Fig 2. of 

    ).

    Therefore, I kept going looking for similar threads and answers. In  AD5941 Potentiometry Basic Example and OCP Basic Example they referenced a GitHub project where they also used a custom design based on the AD5941 chip. In their case, they provide a SE0/RE0/CE0 measurement setup (those three pins available and used for measurement) and presumably make use of this code snippet to perform OCP measurements (IMTEK-FreiStat OCP Setup):

    // Define structs
        AFERefCfg_Type S_AFEReferenceBufferConfig;
        LPLoopCfg_Type S_LPLoopConfig;
        DSPCfg_Type S_DSPConfig;
    
        // Disable all control signals of the AFE 
        AD5940_AFECtrlS(AFECTRL_ALL, bFALSE);
    
        // Disable high power band-gap
        S_AFEReferenceBufferConfig.HpBandgapEn = bTRUE;
    
        // Enable high power 1.1 V reference buffer
        S_AFEReferenceBufferConfig.Hp1V1BuffEn = bTRUE;
    
        // Enable high power 1.8 V reference buffer
        S_AFEReferenceBufferConfig.Hp1V8BuffEn = bTRUE;
    
        // Disable discharge of 1.1 V capacitor
        S_AFEReferenceBufferConfig.Disc1V1Cap = bFALSE;
    
        // Disable discharge of 1.8 V cpacitor
        S_AFEReferenceBufferConfig.Disc1V8Cap = bFALSE;
        
        // Disable thermal buffer
        S_AFEReferenceBufferConfig.Hp1V8ThemBuff = bFALSE;
    
        // Disable current limit for 1.8 V buffer
        S_AFEReferenceBufferConfig.Hp1V8Ilimit = bFALSE;
    
        // Disable 1.1 V reference buffer
        S_AFEReferenceBufferConfig.Lp1V1BuffEn = bFALSE;
    
        // Disable 1.8 V reference buffer                                                       
        S_AFEReferenceBufferConfig.Lp1V8BuffEn = bFALSE;
        
        // Enable low power band gap
        S_AFEReferenceBufferConfig.LpBandgapEn = bTRUE;
    
        // Enable 2.5 V reference buffer
        S_AFEReferenceBufferConfig.LpRefBufEn = bTRUE;
    
        // Disable boost buffer current
        S_AFEReferenceBufferConfig.LpRefBoostEn = bFALSE;
    
        // Configure reference buffer
        AD5940_REFCfgS(&S_AFEReferenceBufferConfig);
        
        /*************************************************************************/
        // Low power amplifier config
        // Chose LPAMP0 because LPAMP1 is only available on ADuCM355
        S_LPLoopConfig.LpAmpCfg.LpAmpSel = LPAMP0;
    
        // Enable potential amplifier
        S_LPLoopConfig.LpAmpCfg.LpPaPwrEn = bTRUE;
    
        // Enable low power TIA amplifier
        S_LPLoopConfig.LpAmpCfg.LpTiaPwrEn = bTRUE;
    
        // Size of the first order RC resistor
        S_LPLoopConfig.LpAmpCfg.LpTiaRf = LPTIARF_20K;
    
        // Get stored LPTIA load size
        S_LPLoopConfig.LpAmpCfg.LpTiaRload = c_DataStorageGeneral_->
            get_LPTIALoadSize();
      
        // Get stored LPTIA Rtia size
        S_LPLoopConfig.LpAmpCfg.LpTiaRtia = c_DataStorageLocal_->
            get_LPTIARtiaSize();
    
        // Check if external resistor is used
        if (S_LPLoopConfig.LpAmpCfg.LpTiaRtia == LPTIARTIA_OPEN){
            // Close switches to support external resistor
            S_LPLoopConfig.LpAmpCfg.LpTiaSW = LPTIASW(8) | 
                                              LPTIASW(4) | 
                                              LPTIASW(5) | 
                                              LPTIASW(9);
        }                             
        else {
            // Close swtiches to support internal resistor
            S_LPLoopConfig.LpAmpCfg.LpTiaSW = LPTIASW(8) | 
                                              LPTIASW(4) ;          // removed switch 5
        }
        
        /*************************************************************************/
        // Low power DAC config
        // Chose LPAMP0 because LPAMP1 is only available on ADuCM355
        S_LPLoopConfig.LpDacCfg.LpdacSel = LPDAC0;
    
        // Set potential of the working electrode to 1.1 V
        S_LPLoopConfig.LpDacCfg.DacData6Bit = 
            (uint32_t)((AD5940_MAX_DAC_OUTPUT - AD5940_MIN_DAC_OUTPUT) / 2 * 
            AD5940_6BIT_DAC_1LSB);
    
        // Set potential of the reference electrode to 1.1 V
        S_LPLoopConfig.LpDacCfg.DacData6Bit = 
            (uint32_t)((AD5940_MAX_DAC_OUTPUT - AD5940_MIN_DAC_OUTPUT) / 2 * 
            AD5940_6BIT_DAC_1LSB);      
    
        // Disable data reset
        S_LPLoopConfig.LpDacCfg.DataRst = bFALSE;
    
        // Disable connection from DACS to amplifieres
        S_LPLoopConfig.LpDacCfg.LpDacSW = 0; 
    
        // Set reference for Low power DAC to internal 2.5 V
        S_LPLoopConfig.LpDacCfg.LpDacRef = LPDACREF_2P5;
    
        // Set data source to REG_AFE_LPDACDAT0DATA0
        S_LPLoopConfig.LpDacCfg.LpDacSrc = LPDACSRC_MMR;
    
        // Connect 12-Bit DAC to Vbias
        S_LPLoopConfig.LpDacCfg.LpDacVbiasMux = LPDACVBIAS_12BIT;
    
        // Connect 6-Bit DAC to Vzero
        S_LPLoopConfig.LpDacCfg.LpDacVzeroMux = LPDACVZERO_6BIT;
    
        // Power up register where 6-Bit and 12-Bit DAC write their data to.
        S_LPLoopConfig.LpDacCfg.PowerEn = bTRUE;
    
        // Configure low power loop (DAC and amplifier)
        AD5940_LPLoopCfgS(&S_LPLoopConfig);
    
        /*************************************************************************/
        // Configure digital signal processor (DSP)
        // Set all members of the structure to 0
        AD5940_StructInit(&S_DSPConfig, sizeof(S_DSPConfig));
    
        // Set negative input channel of ADC to LPTIA0 negative input mode
        S_DSPConfig.ADCBaseCfg.ADCMuxN = ADCMUXN_LPTIA0_N;
    
        // Set positive input channel of ADC to LPTIA0 positive input mode
        S_DSPConfig.ADCBaseCfg.ADCMuxP = ADCMUXP_LPTIA0_P;
        
        // Config digital signal processor (DSP)
        AD5940_DSPCfgS(&S_DSPConfig);

    FINAL REQUEST

    I would like thus to understand which switches are being used here and why, and whether this is a valid configuration for performing OCP measurements or one could find a different/better/simpler one.

    The thing is I cannot follow the explanations from  in  AD5941 Potentiometry Basic Example and OCP Basic Example regarding which switches are closed and their repercussions as she tried to explain the aforementioned code snippet and the possibilities when performing an OCP measurement.

    I really hope I am more clear this time. Thanks a lot in advance!

  • Hi,

    Thank you for detailing your question here.

    The way I understand your question is that you want to measure the impedance between the Reference (RE) and the working electrode (WE) without forcing a voltage in the Counter Electrode (CE). Is this correct?

    If my understanding above is correct, let me assume the pins that you are using here.
    CE0 for Counter Electrode (CE)

    RE0 for Reference Electrode, and

    SE0 for Working Electrode.

    The AD5940 measures the impedance by measuring the current through the Impedance being measured using the TIA. That current is then compared against the current flowing through a known Resistance which we call RCAL. See this link: AD5940_Impedance [Analog Devices Wiki]

    So, what you need to do is to measure the current across RCAL first. The Impedance example in GitHub should have this routine implemented. 

    Then you will have to force the same waveform to the resistor across RE0 and SE0, and this waveform is coming out of PA in the figure you have above. To do this you have to OPEN SW2 because you don't want to bias CE0, and then CLOSE SW15 since you want to route the waveform to RE0. CLOSE SW8 because you need the feedback loop to PA.

    The next step is to measure the current at SE0. Here, you need to use RLOAD and LPTIA which are internal. Set these so that the output of your LPTIA will not overange the ADC. SW0 and SW1 should remain open since you're not using RC0_0/1. CLOSE SW5 and SW9 so you have a path to the ADC.

    As for the code, we have examples in GitHub that can be used as a reference. Unfortunately, I do not have the bandwidth to modify and test the code so this is the most I can do to help. 

    Hopefully this helps. 

    regards,

    Mark

  • Thanks for your response ,

    I am afraid I wasn't clear enough with my question. I 'just' want to measure the voltage between let's say RE0 and SE0 pins as when performing an Open Circuit Potential (Open Circuit Potentiometry, OCP) measurement. However, I cannot go directly from the pins to the ADC MUX as I need as high an input impedance as I can get from the AFE (i.e. using an op-amp which I guess LPTIA could do the work). It would be the same case scenario needed for performing pH measurements by reading the voltage from a pH bulb or pH meter electrode: high input impedance is a must.

    That's why I asked about the LPTIA SW configurations to do this trick, because as far as I've seen in the answers of the mentioned topics, either I cannot implement them in my design or they're quite unclear when explaining the switch configuration and its outcome.

    Thank you very much!

    All the best,

    Andrés Alberto

  • Hi,

    To measure the voltage across RE0 and SE0, you must still perform differential measurements and need 2x High Input impedance. So now I think that you are looking at the wrong figure in the Datasheet.

    Figure 32 shows the ADC Input Channel, and as you can see here, there is an option to direct SE0 and RE0 pins to the Front-end buffer. Is this enough for your application? Just note that if you are implementing this, then you have to disconnect all the switches to RE0 and SE0 from the figure that you had earlier. 

    regards,

    Mark

  • Thank you very much for your response,

    Yes, I see them in Figure 32 right after the ADC INPUT MUX, and they should be enabled by default regarding the configuration of the ADCBUFCON register, right?
    Therefore, they should have been enabled whenever I used `AD5940_ADCMuxCfgS(ADCMUXP_AIN1, ADCMUXN_AIN0);` in the very first tests with no success.

    I am afraid this won't be enough or I am missing something.

    Moreover, you mentioned:

    then you have to disconnect all the switches to RE0 and SE0 from the figure that you had earlier. 

    Would the aim of this be for the signal to avoid the LPTIA (and a bias voltage to RE0)?

    Thanks a lot for your time!

  • Hi,

    These buffers are enabled by default as writing 1 to ADCBUFCON will disable the buffers.

    Yes - disconnecting RE0 and SE0 aims to avoid biasing RE0. 

    regards,

    Mark

  • I will try to perform the tests again with your suggested configuration.

    In the case it does not work I am afraid I would need to stick to the use of the LPTIA in my configuration as suggested earlier by  and the code I mentioned previously. Thus, I would still need to figure out these other configurations...

    Thanks!

  • Hi,

    The AD5940 datasheet shows where the switches connect to and those can be configured via the registers. 

    I will close this forum now if that's ok.

    regards,

    Mark