Post Go back to editing

Details on using sweep and impedance measurement AD5940/AD5941

Category: Hardware
Product Number: AD5940/AD5941

Hello, 

I am trying to conduct an impedance measurement without sequencing and interrupts. I would like some clarification as to how the waveform generator sweep function works, specifically in the Impedance.c example provided. 

According to the Sweep CFG: 

typedef struct
{
      BoolFlag SweepEn;         /**< Software can automatically sweep frequency from following parameters. Set value to 1 to enable it. */
      float SweepStart;         /**< Sweep start frequency. Software will go back to the start frequency when it reaches SWEEP_STOP */
      float SweepStop;          /**< Sweep end frequency. */
      uint32_t SweepPoints;     /**< How many points from START to STOP frequency */
      BoolFlag SweepLog;        /**< The step is linear or logarithmic. 0: Linear, 1: Logarithmic*/
      uint32_t SweepIndex;      /**< Current position of sweep */
}SoftSweepCfg_Type;

It goes back to start frequency when it reaches SWEEP_STOP, but how does it do this? Automatically, sure but how? 

Does the AFE need to be put to sleep every time the frequency changes? I noticed that it is waken up at every interrupt and then the frequency is altered. There is no information in the datasheet if the AFE needs to be put to sleep, but the AFE is put to sleep across a lot of the examples. Can I simply use AD5940_SweepNext without harm? Or is there a way to properly establish a start frequency, output it on the waveform generator, and configure the AFE prior to configuring the generator for the next frequency step?

Additionally, Is there a way to control how long to wait before taking a measurement with impedance? The sequencer makes it seem like it happens one after the other rather than simultaneously, so I am confused. Upon looking at another question where there was no sequencer: AD5941 Impedance Frequency Sweep without the Sequencer and Interrupts - Q&A - Precision ADCs - EngineerZone (analog.com), it seemed that there was no way to control the delay to wait for the signal to stabilize prior to taking a measurement. Furthermore, the provided example in the above Q&A doesn't actually do a frequency sweep so I am wondering how I could utilize a frequency sweep for impedance measurements without the sequencer, and how to properly configure the AFE when I want to change the frequency. 

Thanks. 

  • Hi,

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

    Regards,

    JC

  • Hi,

    In the AD5940.c file, you will see the AD5940_SweepNext function. This function will calculate the next frequency for the sweep. It uses a SweepIndex variable to know what point in the sweep it is currently at and if it reaches the last point it will set the SweepIndex back to 0. The calculated frequency in the AD5940_SweepNext  will then be used by AppIMPRegModify and AD5940_WGFreqCtrlS functions to set the frequency of the waveform generator.

    The AD5940 doesn't need to sleep to jump to the next frequency. You also have control over the wait time before taking impedance measurements. The sleep and waits can both be modified in the AppIMPSeqMeasureGen function. Just note that if you modify this function, you will also need to modify or move the location of the AppIMPRegModify function, or else your sequence will not jump into the next frequency.

    regards,

    Mark