Post Go back to editing

AD5941 Cant Wake, Wrong ADIID

Category: Hardware
Product Number: AD5941

Hello,

I am using a combination of many AD5941 chipsets and I run into the same problem once in a while where I cant successfully wake with AD5940_WakeUp(10). The boards will be working great but the random one will get into an endless loop where it cant wake and the ADIID Register (x400) returns 0xA0A0 eternally instead of the expected 0x4144. This is fixed by a power reset.

This is using a variant of the amperometric example.

What are the expected causes of this? I suspect that it could be due to brown out but I read that I should be getting 0x8080 when this happens.

Thanks,

Andrew

  • Hi   ,

    We will look into this. I will contact the product owner and get back to you.

    Regards,

    JC

  • Hi,

    Is the device entering sleep by AD5940_EnterSleepS() function?

    The low power buffers are used in hibernate mode to maintain the charge on the decoupling capacitors to enable faster wakeup from hibernate mode

  •   

    Yes thats correct. I am using AD5940_EnterSleepS(). Here is my code below, I did change the function names a little but you can see that I am using this routine in the sequencer.

    Most of the time, I wait for the FIFO_THRESH interrupt and I can wake up the device to pull the FIFO data and process it. But 3 hours into sampling, this error happens where I cant wake up. And it happens on all 4 of my AD5941 chips within my PCB.

    bool AmperometricImplementation::measureSequence(void)
    {
       ampLog.trace("CS %d: %s", config.chipSelect, __func__);
       AD5940Err error = AD5940ERR_OK;
       uint32_t const* pSeqCmd;
       uint32_t SeqLen;
    
       uint32_t WaitClks;
       ClksCalInfo_Type clks_cal;
    
       clks_cal.DataType        = DATATYPE_SINC2;
       clks_cal.DataCount       = 1;
       clks_cal.ADCSinc2Osr     = ADC_SINC_2OSR;
       clks_cal.ADCSinc3Osr     = ADC_SINC_30SR;
       clks_cal.ADCAvgNum       = 0;
       clks_cal.RatioSys2AdcClk = SYS_CLK_FREQ / ADC_CLK_FREQ;
       afeClksCalculate(&clks_cal, &WaitClks);
    
       WaitClks += 15;
       afeSEQGenCtrl(bTRUE);
       afeSEQGpioCtrlS(AGPIO_Pin2);
       afeAFECtrlS(AFECTRL_ADCPWR | AFECTRL_SINC2NOTCH, bTRUE);
       afeSEQGenInsert(SEQ_WAIT(16 * 250)); /* wait 250us */
       afeAFECtrlS(AFECTRL_ADCCNV, bTRUE);  /* Start ADC convert*/
       afeSEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
       afeAFECtrlS(AFECTRL_ADCCNV, bFALSE); /* Stop ADC */
       afeSEQGpioCtrlS(0);
    
       afeWriteReg(REG_ALLON_EI2CON, 0x0009);  // Ensure SPI can wake the device
       afeEnterSleepS();                       /* Goto hibernate by setting SEQTRGSLP */
    
       /* Sequence end. */
       error = afeSEQGenFetchSeq(&pSeqCmd, &SeqLen);
       afeSEQGenCtrl(bFALSE); /* Stop sequencer generator */
    
       if (error == AD5940ERR_OK) {
          MeasureSeqInfo.SeqId      = SEQID_0;
          MeasureSeqInfo.SeqRamAddr = InitSeqInfo.SeqRamAddr + InitSeqInfo.SeqLen;
          MeasureSeqInfo.pSeqCmd    = pSeqCmd;
          MeasureSeqInfo.SeqLen     = SeqLen;
          /* Write command to SRAM */
          afeSEQCmdWrite(MeasureSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
       }
       else {
          ampLog.warn("CS %d: Failed to fetch SEQ Info", config.chipSelect);
          return false;
       }
       return true;
    }

  • And I use the following for the actual interrupt service routine when I go to process the data

    AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK);
  •   For the time being am I able to have the measurement sequence never hibernate? The wake up timer should theoretically just start up the sequence again regardless of what happening. But what happens when I dont end a sequence with a hibernation and there arent any commands left to execute? Does it just wait?

  • You can end a sequence without putting it to sleep. The timer (based on Wake up timer configuration) just goes to the next sequence after completing the current sequence.

  •  Can I make it wait without sleeping? Just so that I can still control the sample rate.

  • Hi,

    Could you tell where you are waking up the device from sleep?

     The measure sequence above does configuration, measurement and puts the device to sleep.

    Are you doing 

    if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
    return AD5940ERR_WAKEUP; /* Wakeup Failed */

    for waking up?

  • Yes. 

    Inserting waitclks in sequence is done the same way as you have already done in your measure sequence above:

    AD5940_SEQGenInsert(SEQ_WAIT(WaitClks));