Post Go back to editing

How to Increase Sampling Rate For The EVAL-AD5940BIOZ Board (Impedance Measurements)

Hello, 

I was wondering how the sampling rate for the EVAL-AD5940BIOZ board can be changed or is there a buffer limit to the number of samples that can be taken?. I am currently using the IAR software program and SerialTerm Capture to record the outputting data. I ran a sample test with a 1kOhm resistor for 1 second and I was able to record 184 lines of data. I am aiming to increase the sampling rate to 2,000 samples/second. I have already changed certain lines of code given by Github to run the example project, I will include those changes down below.  Any suggestions or thoughts would be greatly appreciated. Thank you!. 

  • Hello, 

    Just wanted to reach out again regarding this question to see if anybody has some possible input on this? thank you!

  • Hi,

    Inside the measure function, you may add the code snippet below, to know the max allowed ODR for a given configuration:

      AppBIACfg.MeasSeqCycleCount = AD5940_SEQCycleTime();

      AppBIACfg.MaxODR = 1/((( AppBIACfg.MeasSeqCycleCount + 10) / 16.0)* 1E-6)  ; //If Sysclk is16MHz

      if(AppBIACfg.AmpODR > AppBIACfg.MaxODR)

      {

      /* We have requested a sampling rate that cannot be achieved with the time it takes to acquire a sample.*/

    AppBIACfg.AmpODR = AppBIACfg.MaxODR;

      }

    Also in AD5940_SEQCycleTime() function definition in AD5940.c ,

                    

     Change “ for(i=0;i<SeqGenDB.RegCount;i++)  “   to  “for(i=0;i<SeqGenDB.SeqLen;i++)”.

  • Hello Akila, 

    Thank you for the response. Is the snippet code for the body impedance function or 2-wire BIOZ function? 

  • It can be used for all the projects in AD594x 

  • Hi Akila, 

    When you mentioned adding the code snippet in the measurement function, are you referring to the line below " ODR (Sample Rate) 5 Hz */ "?

    Also, you mentioned that it would allow me to determine the max sampling rate for the BIOZ configuration. Would the max sampling rate be outputted after I download and debug or run an actual experimental test and export the file from RealTerm Capture?. 

    Thank you!

  • Hi Akila, 

    Sorry to bother you again, I forgot to mention this from yesterday's comment but is the snippet code supposed to have the same exact spacing as you indicated in your reply? 

  • Add the code snippet:

    AppBIACfg.MeasSeqCycleCount = AD5940_SEQCycleTime();

    AppBIACfg.MaxODR = 1/((( AppBIACfg.MeasSeqCycleCount + 10) / 16.0)* 1E-6)  ; //If Sysclk is16MHz

      if(AppBIACfg.AmpODR > AppBIACfg.MaxODR)

      {

      /* We have requested a sampling rate that cannot be achieved with the time it takes to acquire a sample.*/

    AppBIACfg.AmpODR = AppBIACfg.MaxODR;

      }

    inside AppBIASeqMeasureGen() function 

  • Hi Akila, 

    So I used the same exact codes you have provided to me and inserted them in the "AppBIOZSeqMeasureGen() function" instead of the "AppBIASeqMeasureGen() function" that you pointed out in your previous post. I also changed the configurations of "AppBIACfg." to the "AppBIOZCfg." to match the 2-Wire BIOZ impedance example on IAR. When I rebuild the project I get the following errors: 

    I also want to mention that I am getting similar errors even when I add the snippet code to the "AppBIASeqMeasureGen() function". The error messages indicate that the "AppBIACfg." is undefined. Any suggestions? Thank you!

  • Hi,

    You have to add the relevant fields in bodyImpedance.h:

    SEQInfo_Type InitSeqInfo;
    SEQInfo_Type MeasureSeqInfo;
    BoolFlag StopRequired; /* After FIFO is ready, stop the measurement sequence */
    uint32_t FifoDataCount; /* Count how many times impedance have been measured */
    uint32_t MeasSeqCycleCount; /* How long the measurement sequence will take */
    float MaxODR; /* Max ODR for sampling in this config */
    /* End */
    }AppBIACfg_Type;

    Also change AmpODR to BiaODR

  • Hi Akila, 

    I have two questions:
    Q1: I inserted the above code snippet in the BIOZ-2Wire.c and printed the parameters using printf, see the images attached for the code snippets and output. The SysClkFreq prints 16MHz correctly, but the AD5940_SEQCycleTime() prints what appears to be a random or unassigned number (1.49e-154), making the calculation of the MAxODR incorrect or useless. Should AD5940_SEQCycleTime() be defined somewhere?
    Q2: Is it possible to get the number of samples for a specified measurement time - like a 1 second or 10 second time period?
    Thank you!