Post Go back to editing

Convert ADC Code to current in Amperometric measurement

Thread Summary

The user inquires about the adjustability of ADCPgaGain during a single measurement and the determination of RtiaCalValue.Magnitude in the AD5940 amperometric code. The final answer confirms that ADCPgaGain can be updated in the AppAMPRegModify() function and explains that RtiaCalValue.Magnitude is the calibrated value of the internal RTIA resistor, set by the AppAMPRtiaCal() function using the AppAMPCfg.LptiaRtiaSel parameter.
AI Generated Content
Category: Software
Product Number: AD5940
Software Version: Keil5

Hi,

I am looking into the code of amperometric for AD5940 and have two questions. Is ADCPgaGain adjustable during a single measurement? What I found the most confusing is the calculation of current. How is RtiaCalValue.Magnitude determined? I did not find it in the code. Attached is the relevant code. I really appreciate your answers.

Thanks,

Peter

  • Hi,

    1) After each measurement, you can change ADC PGA gain by updating it inside AppAMPRegModify() function by including below lines in it:

     DSPCfg_Type dsp_cfg;

    dsp_cfg.ADCBaseCfg.ADCPga = new PGA gain value;

    AD5940_DSPCfgS(&dsp_cfg);

    2) RtiaCalValue.Magnitude is the magnitude of calibrated value of internal RTIA resistor ( feedback resistor of LPTIA). 

    This calibration is done by AppAMPRtiaCal() function.

     AppAMPRtiaCal() function needs RTIA value input from user which is set by AppAMPCfg.LptiaRtiaSel.