Hello ADI Community,
I am developing a combined, synchronized Electrocardiogram (ECG) and Impedance Cardiography (ICG / BIA) application using the EVAL-ADICUP3029 paired with the AD5940 BioZ shield. I am using Keil µVision and the standard AD5940 firmware library (v0.2.1).
My Goal: To achieve a simultaneous ECG and single-frequency (50 kHz) BIA measurement at a 512 Hz Output Data Rate. Because the AD5940 has a single ADC, my strategy is to interleave the measurements using the sequencers:
-
The Wake-Up Timer (WUPT) runs at 512 Hz and wakes up Sequencer 0 (ECG).
-
Sequencer 0 configures the ADC for SINC3, takes the ECG measurement, pushes it to the FIFO, and then uses a register write (
SEQ_WR) to instantly trigger Sequencer 1 (BIA). -
Sequencer 1 configures the switches/DFT, takes the ICG measurement, pushes it to the FIFO, and goes to sleep.
The Issue: The code compiles flawlessly and the SPI communication is verified (the board prints the correct silicon version and library info). However, immediately after starting the applications, the stream stops. No data is ever printed, and polling the FIFO count (AD5940_FIFOGetCnt()) always returns 0.
Here is my terminal output before it hangs:
==================================
ADICUP3029 BOOT SUCCESSFUL!
Mode: Synchronized ECG + ICG
==================================
This AD594x!
Note: Current Silicon is S2
AD5940LIB Version:v0.2.1
Configuring ECG Sequencer...
Configuring BIA Sequencer...
Starting Synchronized Measurements!
Key Setup Details:
1. FIFO Configuration (Routing both sources):
fifo_cfg.FIFOEn = bFALSE;
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
fifo_cfg.FIFOSize = FIFOSIZE_4KB;
fifo_cfg.FIFOSrc = FIFOSRC_DFT | FIFOSRC_SINC3; /* Both sources */
fifo_cfg.FIFOThresh = 8;
AD5940_FIFOCfg(&fifo_cfg);
fifo_cfg.FIFOEn = bTRUE;
AD5940_FIFOCfg(&fifo_cfg);
2. WUPT Master Timer (Triggering ECG only):
wupt_cfg.WuptEn = bTRUE;
wupt_cfg.WuptEndSeq = WUPTENDSEQ_A;
wupt_cfg.WuptOrder[0] = SEQID_0; /* Wake up ECG first */
wupt_cfg.SeqxSleepTime[SEQID_0] = (uint32_t)(32000.0 / 512.0) - 2 - 1;
wupt_cfg.SeqxWakeupTime[SEQID_0] = 1;
AD5940_WUPTCfg(&wupt_cfg);
3. The Baton Pass (End of ECG Sequence 0):
/* Disable ADC block to prepare for BIA */
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_ADCPWR, bFALSE);
/* Hardware Trigger Sequence 1 (BIA) */
AD5940_SEQGenInsert(SEQ_WR(0x00002064, 2)); /* Write to REG_AFE_SEQTRG */
/* Put Sequencer 0 to sleep */
AD5940_EnterSleepS();
My Questions:
-
Is writing
2toREG_AFE_SEQTRG(0x00002064) the correct and reliable way to chain Sequencer 0 to Sequencer 1 within the sequence generator? -
When rapidly switching the ADC between SINC3 (for ECG) and DFT (for BIA) at 512 Hz, are there specific ADC/Filter reset or settling commands I must include in the sequences to prevent the ADC from locking up?
-
Can the FIFO safely handle
FIFOSRC_DFT | FIFOSRC_SINC3multiplexing without halting, or does this mixed-data configuration require a specific word-alignment strategy?
Any insight into why the sequencers are failing to cycle or push data into the FIFO would be massively appreciated! Thank you.