Post Go back to editing

EVAL-AD5940ELCZ Fast Chronoamperometry

Category: Software
Product Number: AD5940

Hi,

We have tested EVAL-AD5940ELCZ with on-board dummy and by connecting external 10uf+6.8kohms for various pulse amplitudes and below are the results we are gettiing

EXTERNAL ELECTRODES   RC JP9,10,11=C (10uf + 6.8kohms)											
AmpODR = 0.01  PULSE LENGTH = 1000mS

PA 500mV			Ipeak=73.52uA
LPTIARTIA10K
-69.204643
-64.748947
-59.661701
-55.889885
-51.308575
-44.539547
-38.450905
-33.586967
-29.023104
-25.460636
-21.978426
-19.358042
-16.67485
-14.752308
-12.651814
-11.249157
-9.598769
-8.586904
-7.271477
-6.559682
-5.498968
-5.024437
-4.152139

PA 900mV    Ipeak=132.35uA
LPTIARTIA6K
-108.445564
-101.244171
-93.135323
-87.010078
-79.482925
-69.163643
-59.367886
-52.195572
-44.872021
-39.729832
-34.116463
-30.405247
-26.030891
-23.349276
-19.882366
-17.986038
-15.182263
-13.885082



ON BOARD DUMMY SENSOR      JP6=A, JP9,10,11=B    RC   (10uf + 6.8kohms)											
AmpODR = 0.01  PULSE LENGTH = 1000mS											
PA 500mV			Ipeak=73.52
LPTIARTIA10K
-60.111782
-56.015472
-51.388805
-48.136879
-44.152225
-38.000782
-32.801884
-28.353165
-24.532505
-21.245684
-18.412462
-15.95956
-13.84162
-12.006307
-10.418725
-9.047472
-7.850679
-6.821369
-5.928135
-5.153535
-4.480121
-3.897426
-3.398472
-2.962323

PA 900mV
LPTIARTIA6K
-108.684792
-101.465897
-93.322105
-87.574921
-80.536346
-69.612022
-60.362995
-52.422791
-45.582001
-39.677742
-34.564606
-30.137869
-26.292831
-22.948059
-20.045378
-17.514982

1.Why are we getting all negative values?

Ported ad5940lib to nrf mcu and able to read chip id and adi id.

Now, we want to measure transient response of rc 1nf+4.7kohm.

We are trying to determine whether the current generated by rc 1nf+4.7kohm can be measured using LPTIA or HSTIA is required due to bandwidth and settling time contraints.

To evaluate this, we attempted measuring using HSTIA by setting switch config given as here  sw_cfg and ADC signal path as "Analog -> ADC -> FIFO (raw, source = "sinc3")". But during acquisition we only receive 10–11 samples in console.

2.Is the LPTIA sufficient for measuring current through a 1 nF + 4.7 kΩ RC network, or is the HSTIA required?

3.Are we missing any configurations to obtain continuous high-speed samples (beyond 10–11) when using the HSTIA with the raw ADC → FIFO path?

SM Config
.DswitchSel = SWD_OPEN,
.PswitchSel = SWP_OPEN,
.NswitchSel = SWN_OPEN,
.TswitchSel = SWT_SE0LOAD | SWT_TRTIA,

FIFO CONFIG
fifo_cfg.FIFOEn = bTRUE;
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
fifo_cfg.FIFOSize = FIFOSIZE_4KB;                      
fifo_cfg.FIFOSrc = FIFOSRC_SINC3;
fifo_cfg.FIFOThresh = 10;  

ADC MUX CONFG
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_HSTIA_N;
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_HSTIA_P;   

ADC FILTER CONFIG
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_16; 
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_800KHZ;
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppCHRONOAMPCfg.ADCSinc2Osr;
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppCHRONOAMPCfg.ADCSinc3Osr;
dsp_cfg.ADCFilterCfg.BpSinc3 = bTRUE;
dsp_cfg.ADCFilterCfg.BpNotch = bTRUE;
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;         

Thank you

Edit Notes

Links
[edited by: Kala at 5:46 AM (GMT -5) on 20 Nov 2025]

Thread Notes

Parents
  • Hi,  .

    Can your team please help look into this query?

    Regards,
    Jo

  • Hi,
    Did not get a response to the query...??

    Modified Chronoamperometric example to configure HSDAC+HSTIA for transient measurement. Able to get 800KSPS ODR (ADCRATE_1P6MHZ ,ADCSINC3OSR_2).

    1.When tested with 1nf+4.7Kohm RC for 1ms pulse length, got 800 samples. But if changing pulse length to 2ms, not printing any data on console.

    ADCRATE_1P6MHZ ,ADCSINC3OSR_2 1mspulse -> DataCount: 803  no values when 2ms pulse

    ADCRATE_1P6MHZ ,ADCSINC3OSR_4 1mspulse -> DataCount: 402, 2mspulse ->DataCount: 802 no values when 3ms pulse

    same with ADCSINC3OSR_5 when pulselength is morethan 3ms, no values. In ISR fifocnt is zero. Why it is?

  • 1) Datacount = (PulseLength_in_ms)*800/ADCSinc2Osr/ADCSinc3Osr;

    Max data count = 1024 as data FIFO size is 4kB .

    If ADCSinc2Osr = 1333, ADCSinc3Osr = 5,

    Datacount is 1024 for pulse length of 8.5 secs.

    Hence you may measure for pulse length upto 8.5 seconds.

    If Sinc filters need to be bypassed,

    you may set datacount = x.

    Pulselength would be "waitclks" (derived from datacount =x) in ms. 

     2) You can see the output even when pulse is not fully completed. 

    This happens if fifothreshold is set smaller than datacount. 

    VBias and Vzero are restored in code only after Pulse length duration is completed.

    3) LPDAC can source the data from waveform generator:

    lp_loop.LpDacCfg.LpDacSrc = LPDACSRC_WG;

    where DAC update rate is set by:

    HsDacCfg.HsDacUpdateRate = 7;       /* DAC update rate equals to WG_CLK/HsDacUpdateRate*/

    Reference: ad5940-examples/examples/AD5940_WG at master · analogdevicesinc/ad5940-examples · GitHub

  • Hi,

    As i mentioned earlier,

    modified code

    1.we are using HSDAC to apply pulse, and want to update DAC at user defined slope rate which is v/s. How to set it using HsDacUpdateRate?

    2. In the modified code given,

    AD5940_WriteReg(REG_AFE_HSDACDAT, hs_hi);
    AD5940_SEQGenInsert(SEQ_WAIT(WaitClks));
    AD5940_AFECtrlS(AFECTRL_ADCPWR | AFECTRL_ADCCNV, bFALSE);
    /* Return HSDAC to midscale and stop ADC */
    AD5940_WriteReg(REG_AFE_HSDACDAT, hs_mid);
    
    AD5940_AFECtrlS(AFECTRL_HSTIAPWR | AFECTRL_WG | AFECTRL_DACREFPWR | AFECTRL_HSDACPWR | AFECTRL_INAMPPWR | AFECTRL_EXTBUFPWR, bFALSE);

    setting all AFECTRLs to False, once conversion is done. Is it the reason for not getting correct bias?

    Thank you

  • DAC update rate is set by 8 bit value:

    You may fetch input byte from user and set HsDacUpdateRate.

  • Hi,

    1. I’m having difficulty understanding this part. Could you please explain it more clearly or with an example how it works to set v/s slope given by user?

    2.To measure OCP,  AD5941 Potentiometry Basic Example and OCP Basic Example, it is given VRE0, VSE0 wrt VZERO0. Measuring OCP (Open Circuit Potential) of a 3 electrode system, here it is given wrt ADCMUXN_VSET1P1. When exactly to use vzero0 and vset1p1??

    float App_OCP(void)
    {
      uint32_t afeResult;
      float V_RE0, V_SE0;
    
      SWMatrixCfg_Type sw_cfg;
    
      sw_cfg.Dswitch=SWD_OPEN;
      sw_cfg.Pswitch=SWP_RE0;
      sw_cfg.Nswitch=SWN_SE0;
      sw_cfg.Tswitch = SWT_TRTIA | SWT_SE0LOAD;
    
      AD5940_SWMatrixCfgS(&sw_cfg);
    
        /*Measure VSE*/
      //AD5940_ADCMuxCfgS(ADCMUXP_VSE0, ADCMUXN_VSET1P1);
      AD5940_ADCMuxCfgS(ADCMUXP_VSE0, ADCMUXN_VZERO0);
      AD5940_AFECtrlS(AFECTRL_ADCPWR /*| AFECTRL_SINC2NOTCH*/, bTRUE);
      AD5940_Delay10us(16 * 25);
      AD5940_AFECtrlS(AFECTRL_ADCCNV, bTRUE); /* Start ADC convert*/
      while (!(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ADCRDY)))
        ;
      AD5940_INTCClrFlag(AFEINTSRC_ADCRDY);
      afeResult = AD5940_ReadAfeResult(AFERESULT_SINC3);
      AD5940_AFECtrlS(AFECTRL_ADCPWR | AFECTRL_ADCCNV /*| AFECTRL_SINC2NOTCH*/, bFALSE); /* Stop ADC */
      V_SE0 = AD5940_ADCCode2Volt(afeResult & 0xffff, ADCPGA_1, 1.82);
    
      /*Measure VRE*/
      //AD5940_ADCMuxCfgS(ADCMUXP_VRE0, ADCMUXN_VSET1P1);
      AD5940_ADCMuxCfgS(ADCMUXP_VRE0, ADCMUXN_VZERO0);
      AD5940_AFECtrlS(AFECTRL_ADCPWR /*| AFECTRL_SINC2NOTCH*/, bTRUE);
      AD5940_Delay10us(16 * 25);
      AD5940_AFECtrlS(AFECTRL_ADCCNV, bTRUE); /* Start ADC convert*/
      while (!(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ADCRDY)))
        ;
      AD5940_INTCClrFlag(AFEINTSRC_ADCRDY);
      afeResult = AD5940_ReadAfeResult(AFERESULT_SINC3);
      AD5940_AFECtrlS(AFECTRL_ADCPWR | AFECTRL_ADCCNV /*| AFECTRL_SINC2NOTCH*/, bFALSE); /* Stop ADC */
      V_RE0 = AD5940_ADCCode2Volt(afeResult & 0xffff, ADCPGA_1, 1.82);
    
      return (V_SE0 - V_RE0);
    }
    
    wrt VZERO0, results are as below
    OCP=-0.1539 V 
    OCP=-0.1544 V 
    OCP=-0.1532 V 
    OCP=-0.1449 V 
    OCP=-0.1540 V 
    OCP=-0.1539 V 
    OCP=-0.1529 V 
    OCP=-0.1552 V 
    OCP=-0.1535 V 
    OCP=-0.1551 V 
    OCP=-0.1532 V 
    OCP=-0.1550 V 
    OCP=-0.1543 V 
    OCP=-0.1553 V 
    OCP=-0.1545 V 
    OCP=-0.1557 V 
    OCP=-0.1547 V 
    OCP=-0.1552 V 
    OCP=-0.1543 V 
    OCP=-0.1556 V 
    
    wrt VSET1P1
    OCP=-0.4020 V 
    OCP=-0.4303 V 
    OCP=-0.4166 V 
    OCP=-0.4314 V 
    OCP=-0.4346 V 
    OCP=-0.4293 V 
    OCP=-0.4475 V 
    OCP=-0.4209 V 
    OCP=-0.5000 V 
    OCP=-0.3882 V 
    OCP=-0.4947 V 
    OCP=-0.4169 V 
    OCP=-0.4478 V 
    OCP=-0.5628 V 
    OCP=-0.4950 V 
    OCP=-0.4123 V 
    OCP=-0.4752 V 
    OCP=-0.3938 V 
    OCP=-0.4337 V 
    OCP=-0.4250 V 
    
    

    3.Want to use external rtia.

    On EVAL-AD5940ELCZ, as you have mentioned here EXT DISCRETES, desired external resistance should be placed in RTIA1/RTIA2/RTIA3 right? According to data sheet, it should be connected between DE0 and AINx, but in schematic it is between AIN0 and AIN1/2/3. How to connect HS external rtia and what should be the switch matrix config?

    Thankyou

  • 1) Custom examples cannot be provided on this forum. Kindly contact ADI marketing team on mail for support.

    2) Vzero and Vset1p1 are explained below:

    3) Kindly refer to datasheet for details:

  • Hi,

    1.We have already mailed for support, no response for some clarification regarding FIFO buffer in AD5940....

    I am not asking you to give full custom code, At least you can explain how it works the flow if user want to set dac slope. I have understood that DAC update rate will give update frequency of dac by that we can get update time... what about voltage?

    2.If we are uisng lpdac for pulse generation or vzero as HstiaBias when using hsdac then we have to use measure wrt vzero and if hstiabias is HSTIABIAS_1P1 then vset1p1? is my understanding correct?

    3.We have set registers as per datasheet, what about hardware placement of external rtia?????

    here in one of the post you mentioned to connect external rtia is rtia3 if AIN1 input is used.

    i)In data sheet it is mentioned that "When DE0RESCON = 0x97, the RLOAD_DE0 and RTIA_DE0 resistors are short circuit",

    but in driver 

    #define HSTIADERLOAD_0R             0     /**< set bit[2:0] to 0x00 */

    How will it set DE0RESCON 97??? it will be DE0RESCON :  90
    And we have tested by setting
    DE0RESCON=97,
    pAMPCfg->HstiaRtiaSel = HSTIARTIA_OPEN;  //HSTIA GAIN to set cur
    pAMPCfg->ExtRtia = bTRUE;      /* Set to true if using external Rtia */
    pAMPCfg->ExtRtiaVal = 1000000; /* Enter external Rtia value here is using one */
    hsrtia_cal.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
    hsrtia_cal.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_TODE;
    hsrtia_cal.HsTiaCfg.HstiaRtiaSel = AppCHRONOAMPCfg.HstiaRtiaSel;
    hsrtia_cal.HsTiaCfg.ExtRtia = AppCHRONOAMPCfg.ExtRtiaVal;
    InAD5940_HSRtiaCalfn
     if(pCalCfg->HsTiaCfg.HstiaRtiaSel == HSTIARTIA_OPEN)
      {
        if(pCalCfg->HsTiaCfg.HstiaDeRtia == HSTIADERTIA_TODE)
        {
          RtiaVal = pCalCfg->HsTiaCfg.ExtRtia;
          printk("RtiaVal : %d\n",RtiaVal);
        }
     SWMatrixCfg_Type sw_cfg;
        sw_cfg.Dswitch = SWD_CE0;
        sw_cfg.Pswitch = SWP_CE0;
        sw_cfg.Nswitch = SWN_SE0;
        sw_cfg.Tswitch = SWT_AIN1 | SWT_SE0LOAD;
        AD5940_SWMatrixCfgS(&sw_cfg);
    Getting output
    RtiaVal : 1000000
    HSTIARTIA: Mag:12881.778320 Ohm
    DE0RESCON : 97 in 
    AppHstiaRtiaCal()
    what is wrong in our config that we are not getting correct calibrated value???
    Thank you
  • 1) You have to decide the DAC voltage that you want to set based on user input. It is specific to your application.

    2) yes

    3) Could you please first check if you are getting internal RTIA value correctly obtained by calling AD5940_HSRtiaCal()

  • Hi,

    Yes, with AD5940_HSRtiaCal() we are able to get correct internal RTIA calibrated values. But when calibrating external rtia,

    RtiaVal : 1000000
    HSTIARTIA: Mag:12881.778320 Ohm
    DE0RESCON : 97

    This is the output we are getting.

    1. Register configurations are correct as mentioned in the Datasheet. Can you confirm if hardware placement of external RTIA is correct like mentioned below?

    here in one of the post you mentioned to connect external rtia is rtia3 if AIN1 input is used.

    2. Switch configurations? Any modifications while calibrating external rtia in AD5940_HSRtiaCal()???

    where are we going wrong that we are not able to get correct calibrated values for exteral rtia?

    Thank you

  • Hi Akila,

    Any update on External RTIA Calibration?? followed everything as given in DATASHEET. Verified the configurations set, by reading the registers DE0RESCON and HSTIARTIA. still not able to get correct calibrated value....

Reply Children
No Data