Post Go back to editing

Parallel SPI communication while measuring on AD5941

Category: Hardware
Product Number: AD5941

We are trying to get a very fast impedance measurement on the Ad5941, with the EVAL-AD5941ELCZ evaluation kit. We will need an impedance output at approximately 1000 Hz. The excitation frequency can unfortunately not be very large, it should be around 4000 Hz.

I modified the BIA 4-wire example for my case (e.g. reduced the DFT_NUM to only 128 samples and increased the BiaODR frequency to 1000). It's fast, but not quite fast enough. I captured the sensor SPI, data-ready interrupt and excitation output in the following plot:

It seems the impedance measurement of the chip is paused during SPI communication. Is there some way to run both simultaneously?
Because each frame of SPI takes up quite some time.

Bonus question: there seems a small lull after each SPI frame. I think this is a very small sleep by the AD5941. Starting from the BIA example, how can I skip any sleep states at all and keep it active?

  • Hi,

    Instead of creating sequences and letting timer run the sequences, you may directly call the functions(initialization and measurement and ISR functions) in AD5940Main.c

    This way, sleep is eliminated and code can run at 16MHz instead of 32KHZ (which is the only option for sequences).

  • thanks for your reply. That sounds good, is there an example of this?

    To be honest, the datasheet + library is just too extensive for me to be able make something from scratch.

  • Hi,

    Example:

    *****************************************************************************
    @file:    AD5940Main.c
    *****************************************************************************/
    
    #include "ad5940.h"
    #include "AD5940.h"
    #include <stdio.h>
    #include "string.h"
    #include "math.h"
    #include "Amperometric.h"
    #include "Impedance.h"
    #include "ADuCM3029.h"
    
    #define APPBUFF_SIZE_IMPEDANCE 512
    uint32_t AppBuffImpedance[APPBUFF_SIZE_IMPEDANCE];
    
     uint64_t counter = 0;
    
    /* Initialize AD5940 basic blocks like clock */
    static int32_t AD5940PlatformCfg(void)
    {
      CLKCfg_Type clk_cfg;
      FIFOCfg_Type fifo_cfg;
      SEQCfg_Type seq_cfg;
      AGPIOCfg_Type gpio_cfg;
      LFOSCMeasure_Type LfoscMeasure;
      /* Use hardware reset */
      AD5940_HWReset();
      AD5940_Initialize();
      /* Platform configuration */
      /* Step1. Configure clock */
      clk_cfg.ADCClkDiv = ADCCLKDIV_1;
      clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
      clk_cfg.SysClkDiv = SYSCLKDIV_1;
      clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC;
      clk_cfg.HfOSC32MHzMode = bFALSE;
      clk_cfg.HFOSCEn = bTRUE;
      clk_cfg.HFXTALEn = bFALSE;
      clk_cfg.LFOSCEn = bTRUE;
      AD5940_CLKCfg(&clk_cfg);
      /* Step2. Configure FIFO and Sequencer*/
      fifo_cfg.FIFOEn = bFALSE;
      fifo_cfg.FIFOMode = FIFOMODE_FIFO;
      fifo_cfg.FIFOSize = FIFOSIZE_4KB;                      /* 4kB for FIFO, The reset 2kB for sequencer */
      fifo_cfg.FIFOSrc = FIFOSRC_DFT;
      fifo_cfg.FIFOThresh = 4;      
      AD5940_FIFOCfg(&fifo_cfg);                             /* Disable to reset FIFO. */
      fifo_cfg.FIFOEn = bTRUE;  
      AD5940_FIFOCfg(&fifo_cfg);                             /* Enable FIFO here */
      /* Configure sequencer and stop it */
      seq_cfg.SeqMemSize = SEQMEMSIZE_2KB;
      seq_cfg.SeqBreakEn = bFALSE;
      seq_cfg.SeqIgnoreEn = bFALSE;
      seq_cfg.SeqCntCRCClr = bTRUE;
      seq_cfg.SeqEnable = bFALSE;
      seq_cfg.SeqWrTimer = 0;
      AD5940_SEQCfg(&seq_cfg);
      
      /* Step3. Interrupt controller */
      AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE);           /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
      AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
      AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE);   /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
      AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
      /* Step4: Reconfigure GPIO */
      gpio_cfg.FuncSet = GP0_INT|GP1_SLEEP|GP2_SYNC|GP6_SYNC|GP5_SYNC|GP4_SYNC;
      gpio_cfg.InputEnSet = 0;
      gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin2|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6;
      gpio_cfg.OutVal = 0;
      gpio_cfg.PullEnSet = 0;
      AD5940_AGPIOCfg(&gpio_cfg);
      
      //AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK);  /* Allow AFE to enter sleep mode. */
      /* Measure LFOSC frequency */
      LfoscMeasure.CalDuration = 1000.0;  /* 1000ms used for calibration. */
      LfoscMeasure.CalSeqAddr = 0;
      LfoscMeasure.SystemClkFreq = 16000000.0f; /* 16MHz in this firmware. */
      AD5940_LFOSCMeasure(&LfoscMeasure, &LFOSCFreq);
      printf("Freq:%f\n", LFOSCFreq); 
      return 0;
    }
    
    void AD5940AMPStructInit(void)
    {
      AppAMPCfg_Type *pAMPCfg;
      
      AppAMPGetCfg(&pAMPCfg);
      pAMPCfg->WuptClkFreq = LFOSCFreq;
      /* Configure general parameters */
      pAMPCfg->SeqStartAddr = 0;
      pAMPCfg->MaxSeqLen = 512;     /* @todo add checker in function */  
      pAMPCfg->RcalVal = 10000.0;
      pAMPCfg->NumOfData = -1;      /* Never stop until you stop it manually by AppAMPCtrl() function */	
      
      
      /* Configure measurement parameters */
      pAMPCfg->AmpODR = 0.1;          	/* Time between samples in seconds */
      pAMPCfg->FifoThresh = 1;      		/* Number of measurements before alerting host microcontroller */
      
      pAMPCfg->SensorBias = 0.0f;   			/* Sensor bias voltage between reference and sense electrodes*/ 
      pAMPCfg->LptiaRtiaSel = LPTIARTIA_1K;
      pAMPCfg->LpTiaRl = LPTIARLOAD_100R; 
      pAMPCfg->Vzero = 1100;        		/* Vzero voltage. Voltage on Sense electrode. Unit is mV*/
      
      pAMPCfg->ADCRefVolt = 1.82;		/* Measure voltage on Vref_1V8 pin */
    
    }
    
    void AD5940ImpedanceStructInit(void)
    {
      AppIMPCfg_Type *pImpedanceCfg;
      
      AppIMPGetCfg(&pImpedanceCfg);
      /* Step1: configure initialization sequence Info */
      pImpedanceCfg->SeqStartAddr = 0;
      pImpedanceCfg->MaxSeqLen = 512; /* @todo add checker in function */
      
      pImpedanceCfg->RcalVal = 10000.0;
      pImpedanceCfg->SinFreq = 6000.0;
      pImpedanceCfg->FifoThresh = 2;
      
      pImpedanceCfg->DacVoltPP = 100.0;	/* Maximum value is 600mV*/
      pImpedanceCfg->ExcitBufGain = EXCITBUFGAIN_2;
      pImpedanceCfg->HsDacGain = HSDACGAIN_1;
      
      /* Set switch matrix to onboard(EVAL-AD5940ELECZ) dummy sensor. */
      /* Note the RCAL0 resistor is 10kOhm. */
      pImpedanceCfg->DswitchSel = SWD_CE0;
      pImpedanceCfg->PswitchSel = SWP_RE0;
      pImpedanceCfg->NswitchSel = SWN_SE0;
      pImpedanceCfg->TswitchSel = SWT_SE0LOAD;
      /* The dummy sensor is as low as 5kOhm. We need to make sure RTIA is small enough that HSTIA won't be saturated. */
      pImpedanceCfg->HstiaRtiaSel = HSTIARTIA_40K;	/* #RFMOD increased from HSTIARTIA_5K to HSTIARTIA_40K */
      pImpedanceCfg->BiasVolt = 150.0; /* Bias Voltage in mV*/ /* #RFMOD initialized to zero bias */
    	pImpedanceCfg->DacVoltPP = 40.0;
      pImpedanceCfg->Vzero = 1100; /* Set voltage on SE0 pin. Unit is mV */
      
      /* Configure the sweep function. */
      pImpedanceCfg->SweepCfg.SweepEn = bTRUE;
      pImpedanceCfg->SweepCfg.SweepStart = 100.0f;	/* Start from 1kHz */
      pImpedanceCfg->SweepCfg.SweepStop = 100e3f;		/* Stop at 100kHz */
      pImpedanceCfg->SweepCfg.SweepPoints = 201;		/* Points is 101 */
      pImpedanceCfg->SweepCfg.SweepLog = bFALSE;
      pImpedanceCfg->SweepCfg.SweepCustom = bTRUE; /* Default Sweep */
      /* Configure Power Mode. Use HP mode if frequency is higher than 80kHz. */
      pImpedanceCfg->PwrMod = AFEPWR_HP;
      /* Configure filters if necessary */
      pImpedanceCfg->ADCSinc3Osr = ADCSINC3OSR_2;		/* Sample rate is 800kSPS/2 = 400kSPS */ /*#RFMOD changed from ADCSINC3OSR_4 to ADCSINC3OSR_2*/
    	pImpedanceCfg->AdcPgaGain = ADCPGA_1P5; /*#RFMOD same as default. Just re-initialized here.*/
      //pImpedanceCfg->DftNum = DFTNUM_16384;
    	pImpedanceCfg->DftNum = DFTNUM_4096;
      pImpedanceCfg->DftSrc = DFTSRC_SINC3;
      
     }
    
     int32_t ImpedanceShowResult(uint32_t *pData, uint32_t DataCount, uint64_t Counter)
    {
      float freq;
      int index=0;
      fImpPol_Type *pImp = (fImpPol_Type*)pData;
      AppIMPCtrl(IMPCTRL_GETFREQ, &freq);
    	
    	{
    		//printf("\n-------------------------- CURRENT STATE --------------------------------\n");
    		//  printf("%d,%d,%s,%f,",Counter,(int)rawtime,ctime(&rawtime),freq);
    		printf("%lld,%f,",Counter,freq);
    		/*Process data*/
    		for(int i=0;i<DataCount;i++)
    		{
    			printf("%f,%f,%d,%d,%d,1\n",pImp[i].Magnitude,pImp[i].Phase*180/MATH_PI,pImp[i].Real,pImp[i].Image,i+1);
    		}
    		//printf("\n-------------------------------------------------------------------------\n");
      }
      return 0;
    }
    
     void AD5940_Main(void)
    {
    
    AD5940PlatformCfg();
    AD5940ImpedanceStructInit();
    AppAMPInit(AppBuffAmperometric, APPBUFF_SIZE_AMPEROMETRIC); 
    AD5940_ClrMCUIntFlag(); /* Clear this flag */
    ImpedanceShowResult(AppBuffAmperometric, temp,++counter);
    
    } // Timer and sequence are not called anywhere
    

  • Hi , thank you for your addition. But I don't understand your sample, your main doesn't have a loop at all and it doesn't seem to make a single measurement.

    What triggers a measurement now?

  • Hi,

    Apologies. Missed AppIMPMeasureGen() function:

    *****************************************************************************
    @file:    AD5940Main.c
    *****************************************************************************/
    
    #include "ad5940.h"
    #include "AD5940.h"
    #include <stdio.h>
    #include "string.h"
    #include "math.h"
    #include "Amperometric.h"
    #include "Impedance.h"
    #include "ADuCM3029.h"
    
    #define APPBUFF_SIZE_IMPEDANCE 512
    uint32_t AppBuffImpedance[APPBUFF_SIZE_IMPEDANCE];
    
     uint64_t counter = 0;
    
    /* Initialize AD5940 basic blocks like clock */
    static int32_t AD5940PlatformCfg(void)
    {
      CLKCfg_Type clk_cfg;
      FIFOCfg_Type fifo_cfg;
      SEQCfg_Type seq_cfg;
      AGPIOCfg_Type gpio_cfg;
      LFOSCMeasure_Type LfoscMeasure;
      /* Use hardware reset */
      AD5940_HWReset();
      AD5940_Initialize();
      /* Platform configuration */
      /* Step1. Configure clock */
      clk_cfg.ADCClkDiv = ADCCLKDIV_1;
      clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
      clk_cfg.SysClkDiv = SYSCLKDIV_1;
      clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC;
      clk_cfg.HfOSC32MHzMode = bFALSE;
      clk_cfg.HFOSCEn = bTRUE;
      clk_cfg.HFXTALEn = bFALSE;
      clk_cfg.LFOSCEn = bTRUE;
      AD5940_CLKCfg(&clk_cfg);
      /* Step2. Configure FIFO and Sequencer*/
      fifo_cfg.FIFOEn = bFALSE;
      fifo_cfg.FIFOMode = FIFOMODE_FIFO;
      fifo_cfg.FIFOSize = FIFOSIZE_4KB;                      /* 4kB for FIFO, The reset 2kB for sequencer */
      fifo_cfg.FIFOSrc = FIFOSRC_DFT;
      fifo_cfg.FIFOThresh = 4;      
      AD5940_FIFOCfg(&fifo_cfg);                             /* Disable to reset FIFO. */
      fifo_cfg.FIFOEn = bTRUE;  
      AD5940_FIFOCfg(&fifo_cfg);                             /* Enable FIFO here */
      /* Configure sequencer and stop it */
      seq_cfg.SeqMemSize = SEQMEMSIZE_2KB;
      seq_cfg.SeqBreakEn = bFALSE;
      seq_cfg.SeqIgnoreEn = bFALSE;
      seq_cfg.SeqCntCRCClr = bTRUE;
      seq_cfg.SeqEnable = bFALSE;
      seq_cfg.SeqWrTimer = 0;
      AD5940_SEQCfg(&seq_cfg);
      
      /* Step3. Interrupt controller */
      AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE);           /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
      AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
      AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE);   /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
      AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
      /* Step4: Reconfigure GPIO */
      gpio_cfg.FuncSet = GP0_INT|GP1_SLEEP|GP2_SYNC|GP6_SYNC|GP5_SYNC|GP4_SYNC;
      gpio_cfg.InputEnSet = 0;
      gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin2|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6;
      gpio_cfg.OutVal = 0;
      gpio_cfg.PullEnSet = 0;
      AD5940_AGPIOCfg(&gpio_cfg);
      
      //AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK);  /* Allow AFE to enter sleep mode. */
      /* Measure LFOSC frequency */
      LfoscMeasure.CalDuration = 1000.0;  /* 1000ms used for calibration. */
      LfoscMeasure.CalSeqAddr = 0;
      LfoscMeasure.SystemClkFreq = 16000000.0f; /* 16MHz in this firmware. */
      AD5940_LFOSCMeasure(&LfoscMeasure, &LFOSCFreq);
      printf("Freq:%f\n", LFOSCFreq); 
      return 0;
    }
    
    void AD5940AMPStructInit(void)
    {
      AppAMPCfg_Type *pAMPCfg;
      
      AppAMPGetCfg(&pAMPCfg);
      pAMPCfg->WuptClkFreq = LFOSCFreq;
      /* Configure general parameters */
      pAMPCfg->SeqStartAddr = 0;
      pAMPCfg->MaxSeqLen = 512;     /* @todo add checker in function */  
      pAMPCfg->RcalVal = 10000.0;
      pAMPCfg->NumOfData = -1;      /* Never stop until you stop it manually by AppAMPCtrl() function */	
      
      
      /* Configure measurement parameters */
      pAMPCfg->AmpODR = 0.1;          	/* Time between samples in seconds */
      pAMPCfg->FifoThresh = 1;      		/* Number of measurements before alerting host microcontroller */
      
      pAMPCfg->SensorBias = 0.0f;   			/* Sensor bias voltage between reference and sense electrodes*/ 
      pAMPCfg->LptiaRtiaSel = LPTIARTIA_1K;
      pAMPCfg->LpTiaRl = LPTIARLOAD_100R; 
      pAMPCfg->Vzero = 1100;        		/* Vzero voltage. Voltage on Sense electrode. Unit is mV*/
      
      pAMPCfg->ADCRefVolt = 1.82;		/* Measure voltage on Vref_1V8 pin */
    
    }
    
    void AD5940ImpedanceStructInit(void)
    {
      AppIMPCfg_Type *pImpedanceCfg;
      
      AppIMPGetCfg(&pImpedanceCfg);
      /* Step1: configure initialization sequence Info */
      pImpedanceCfg->SeqStartAddr = 0;
      pImpedanceCfg->MaxSeqLen = 512; /* @todo add checker in function */
      
      pImpedanceCfg->RcalVal = 10000.0;
      pImpedanceCfg->SinFreq = 6000.0;
      pImpedanceCfg->FifoThresh = 2;
      
      pImpedanceCfg->DacVoltPP = 100.0;	/* Maximum value is 600mV*/
      pImpedanceCfg->ExcitBufGain = EXCITBUFGAIN_2;
      pImpedanceCfg->HsDacGain = HSDACGAIN_1;
      
      /* Set switch matrix to onboard(EVAL-AD5940ELECZ) dummy sensor. */
      /* Note the RCAL0 resistor is 10kOhm. */
      pImpedanceCfg->DswitchSel = SWD_CE0;
      pImpedanceCfg->PswitchSel = SWP_RE0;
      pImpedanceCfg->NswitchSel = SWN_SE0;
      pImpedanceCfg->TswitchSel = SWT_SE0LOAD;
      /* The dummy sensor is as low as 5kOhm. We need to make sure RTIA is small enough that HSTIA won't be saturated. */
      pImpedanceCfg->HstiaRtiaSel = HSTIARTIA_40K;	/* #RFMOD increased from HSTIARTIA_5K to HSTIARTIA_40K */
      pImpedanceCfg->BiasVolt = 150.0; /* Bias Voltage in mV*/ /* #RFMOD initialized to zero bias */
    	pImpedanceCfg->DacVoltPP = 40.0;
      pImpedanceCfg->Vzero = 1100; /* Set voltage on SE0 pin. Unit is mV */
      
      /* Configure the sweep function. */
      pImpedanceCfg->SweepCfg.SweepEn = bTRUE;
      pImpedanceCfg->SweepCfg.SweepStart = 100.0f;	/* Start from 1kHz */
      pImpedanceCfg->SweepCfg.SweepStop = 100e3f;		/* Stop at 100kHz */
      pImpedanceCfg->SweepCfg.SweepPoints = 201;		/* Points is 101 */
      pImpedanceCfg->SweepCfg.SweepLog = bFALSE;
      pImpedanceCfg->SweepCfg.SweepCustom = bTRUE; /* Default Sweep */
      /* Configure Power Mode. Use HP mode if frequency is higher than 80kHz. */
      pImpedanceCfg->PwrMod = AFEPWR_HP;
      /* Configure filters if necessary */
      pImpedanceCfg->ADCSinc3Osr = ADCSINC3OSR_2;		/* Sample rate is 800kSPS/2 = 400kSPS */ /*#RFMOD changed from ADCSINC3OSR_4 to ADCSINC3OSR_2*/
    	pImpedanceCfg->AdcPgaGain = ADCPGA_1P5; /*#RFMOD same as default. Just re-initialized here.*/
      //pImpedanceCfg->DftNum = DFTNUM_16384;
    	pImpedanceCfg->DftNum = DFTNUM_4096;
      pImpedanceCfg->DftSrc = DFTSRC_SINC3;
      
     }
    
     int32_t ImpedanceShowResult(uint32_t *pData, uint32_t DataCount, uint64_t Counter)
    {
      float freq;
      int index=0;
      fImpPol_Type *pImp = (fImpPol_Type*)pData;
      AppIMPCtrl(IMPCTRL_GETFREQ, &freq);
    	
    	{
    		//printf("\n-------------------------- CURRENT STATE --------------------------------\n");
    		//  printf("%d,%d,%s,%f,",Counter,(int)rawtime,ctime(&rawtime),freq);
    		printf("%lld,%f,",Counter,freq);
    		/*Process data*/
    		for(int i=0;i<DataCount;i++)
    		{
    			printf("%f,%f,%d,%d,%d,1\n",pImp[i].Magnitude,pImp[i].Phase*180/MATH_PI,pImp[i].Real,pImp[i].Image,i+1);
    		}
    		//printf("\n-------------------------------------------------------------------------\n");
      }
      return 0;
    }
    
    static AD5940Err AppIMPMeasureGen(void)
    {
      AD5940Err error = AD5940ERR_OK;
    
      uint32_t WaitClks;
      ClksCalInfo_Type clks_cal;
    
      clks_cal.DataType = DATATYPE_DFT;
      clks_cal.DftSrc = AppIMPCfg.DftSrc;
      clks_cal.DataCount = 1L<<(AppIMPCfg.DftNum+2); /* 2^(DFTNUMBER+2) */
      clks_cal.ADCSinc2Osr = AppIMPCfg.ADCSinc2Osr;
      clks_cal.ADCSinc3Osr = AppIMPCfg.ADCSinc3Osr;
      clks_cal.ADCAvgNum = AppIMPCfg.ADCAvgNum;
      clks_cal.RatioSys2AdcClk = AppIMPCfg.SysClkFreq/AppIMPCfg.AdcClkFreq;
      AD5940_ClksCalculate(&clks_cal, &WaitClks);	
      
      AD5940_AGPIOSet(AGPIO_Pin2); /* Set GPIO2, clear others that under control */  
      /* Measure Impedance */
      AD5940_WriteReg(REG_AFE_SWCON, (0x5<<BITP_AFE_SWCON_DMUXCON)|(5<<BITP_AFE_SWCON_PMUXCON)\
        |(0x9<<BITP_AFE_SWCON_NMUXCON)|(0x5<<BITP_AFE_SWCON_TMUXCON)|\
          BITM_AFE_SWCON_T9CON);
      
      AD5940_AFECtrlS(AFECTRL_HSTIAPWR|AFECTRL_INAMPPWR|AFECTRL_EXTBUFPWR|\
        AFECTRL_WG|AFECTRL_DACREFPWR|AFECTRL_HSDACPWR|\
          AFECTRL_SINC2NOTCH|AFECTRL_DCBUFPWR, bTRUE);
      AD5940_AFECtrlS(AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bTRUE);  /* Enable Waveform generator */
    
    	/* Delay for ADC power up */
    	AD5940_Delay10us(16*250*100000);
      AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_ADCPWR|AFECTRL_DFT, bTRUE);  /* Start ADC convert and DFT */
      /* Wait for ADC and DFT to finish converting samples */
      AD5940_Delay10us(WaitClks* (AppIMPCfg.AdcClkFreq/AppIMPCfg.SysClkFreq)*100000);
      AD5940_AFECtrlS(AFECTRL_ADCPWR|AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_SINC2NOTCH/*|AFECTRL_WG*/, bFALSE);  /* Stop ADC convert and DFT */
      AD5940_AGPIOClr(AGPIO_Pin2); /* Clr GPIO2 */
      return AD5940ERR_OK;
    }
    
     void AD5940_Main(void)
    {
    
    AD5940PlatformCfg();
    AD5940ImpedanceStructInit();
    AppIMPMeasureGen();
    AD5940_ClrMCUIntFlag(); /* Clear this flag */
    ImpedanceShowResult(AppBuffImpedance, temp,++counter);
    
    } // Timer and sequence are not called anywhere

  • This got a little confusing. To answer my own original question: I am fairly certain SPI communication is already in parallel. This pause you see in the screenshot is a `wait` inside the sequence of the example.

    See Akila's replies for other info.