Post Go back to editing

AD5941 Can AD594x continuously and simultaneously generate a sine wave and process the data via ADC? if yes, can I have the code in BIA formation, please?

Category: Software
Product Number: AD5941
Software Version: AD5940 EXAMPLES

Referring to this question:

 is there way to use ad5940 without interrupt or GPIO interrupt pin? 

I'm not sure if the author ever got it to work, anyway, so I have a requirement to generate the sinewave of programmable freq continuously in BIA setup (4 wire setup), and continuously get the ADC data, not stopping ever, till I manually stop it.

The current BIA example uses a sequencer, and the WG stops and starts all the time, as I cheded on the oscilloscope. I'm okay with the interrupt to trigger to notify if the data is ready, but not sure if I should use the sequencer? I tried to write the example myself without the sequencer, but it didn't work, and hence I'm here asking for help.

So, here's a question: Can AD594x continuously and simultaneously generate a sine wave and process the data via ADC? if yes, can I have the code in BIA formation, please?

Parents
  • Hi,

    You may just remove the sleep command from all sequences in BIA code.

    That is remove the below line wherever it is called:

    AD5940_EnterSleepS();

    Also inside measure sequence, WG block is turned off. You may remove the red part below:

    AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE);  /* Stop ADC convert and DFT */

  • Thanks for the reply. I implemented the changes, however, the WG stops/starts frequently, please see the attached screenshot. Could you share the code that you got it to work?

  • Thanks, the code provided does work.

    I have removed the floating switch part, so the sine wave is continuous as checked on an oscilloscope.

    So, this is what I am trying to do now:

    I'm injecting the continuous sine wave generated between CEO and Ain1, and measuring the voltage across part of the body (forearm) between Ain2 and 3. This part works.

    I'm trying to measure the heart rate, and as you can see it is sort of working, but not quite yet

    I want to understand, does some TIA or input current or anything else is trying to stabilize or auto-calibrate periodically? The impedance values shift i.e. either increases or decreases over time as if trying to stabilize or something. Do you know why it could be happening? 

    PS: In the figure above, don't look at the values but look at the pattern i.e. the the pattern is slanting downwards to the right from left means impedance values are decreasing over time for a fixed electrode position on the body.

  • Hi,

    If the requirement is to measure heart rate, may I know why you are not using the AD5940_ECG example?

    May I know if you are testing using eval board or on your custom board?

    If using Eval-AD5940BIOZ board with ECG probes stuck on bodyAD5940_ECG example gives below measurement output:

    Note: Eval board uses AD8233 (heart rate monitor) along with AD5940.

  • Hmm, good point, I'll probably look into it, I used AD8421 as my IA, but I will check it out, thanks! 

    So coming back to the slanting issue mentioned above, could you think of anything why it could be happening?

    Also, I do appreciate your help in this matter!

    Edit: I think the methodology to measure the HRM via AD8233 vs the way I'm doing is different. I'm amplitude modulating the pulse signal vs the conventional way AD8233 acquires the ECG signal. Quick question, when AD8233 is operational, is AD594x injecting current in the body?

  • Also, whats the max Bia ODR? I can see it's 20 currently.

  • BIA ODR can go upto 3kHz. However, in Sensorpal, it is limited to 20.

  • Hi,

    No. AD594x doesn't inject any current.

  • Hi Akila,

    Could you please tell me where should I make changes in the code above to get an ODR of 3k Hz? I changed the BIAODR to 3k, but it didn't work.

    Shravan

  • Hi,

    Kindly watch the value of MAXODR for different configurations, so that you may choose the config with maximum MAXODR.

    (MAXODR is defined in the default BIA example in Github)

  • MAXODR

    So I checked the code and it says:

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

    I guess this is what you mean? 

    The other comment is "DFT number and sample frequency decides the maxim ODR", I changed the DFT number to DFTNUM_16384 and it didn't do anything. Also, my DAC freq is below 80kHz.

  • Hi,

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

Reply Children
No Data