Post Go back to editing

waveform generator not outputting signal in Impedance example

Category: Software

I am using the impedance example for ad5940-examples/examples/AD5940_Impedance at master · analogdevicesinc/ad5940-examples (github.com) in Impedance.c and AD5940_Main.c for an ESP32 port. 

The problem is that I'm getting the following readings of noisy data: 


Freq, RzMag (ohm), RzPhase (degrees)
1000.00, 442.177460, -261.869904
1047.13, 331.633087, 135.000015
1096.48, 0.000000, -180.000015
1148.15, 3.727768, 84.343788
1202.26, 476.197327, -203.962509
1258.93, 1483.108154, 161.565048
1318.26, 0.000000, -71.565056
1380.38, 0.000000, -180.000015
1445.44, 1048.715820, 153.434967
1513.56, 1300.771973, 33.690071
1584.89, 548.922974, -200.556061
1659.59, 1440.522095, -10.619654

I used an oscillosope to view the CE pin but only found noisy waveforms from WG. 

This is the only thing I changed for testing: 

pImpedanceCfg->RcalVal = 4690.0;
    pImpedanceCfg->SinFreq = 60000.0;
    pImpedanceCfg->FifoThresh = 4;
       
    /* 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_5K;
My setup is that I have CE and RE tied together and connected to one end of the resistor, and SE on the other end. If CE is not connected to anything, the program just outputs the RcalVal of 4690 as shown below. I think the DFT is working as expected, but for some reason the WG is not outputting any sine wave, not even a noisy one when I run the impedance code.
Freq, RzMag (ohm), RzPhase (degrees)
1047.13, 4690.000000, -270.000031
1096.48, 4690.000000, 0.000000
I've tried it with three chips now, and I don't think it could be a destroyed chip issue (or maybe it is and I'll keep looking into it). But unsure as to why the waveform generator is not working with the impedance code, even though I can manually sweep the WG in another program. 
Thanks.