Post Go back to editing

AFEINTSRC_CUSTOMINT0 IRQ never triggers in SWV example

Product Number: AD5940
Software Version: NA

Using latest SWV source and the AFEINTSRC_CUSTOMINT0 IRQ is never firing. The code used is from this post:  RE: Could not get expected result using AD5940 with demo application provided 

I repeatedly send the ramps and measure on a timer. The ramp is built in the AppSWVInit call, but the only interrupt that fires is the AFEINTSRC_ENDSEQ flag. This means that the final call to AppSWVSeqDACCtrlGen never occurs.  I'm also not getting any ramp to show up when probing the CE,RE outputs.

What would cause the AFEINTSRC_CUSTOMINT0 to never fire?

Thanks!

Parents Reply Children
  • Hello Akila,

    I've dug into those links several times and will review again. But what would cause the AFEINTSRC_CUSTOMINT0 interrupt to never fire?

    Marty

  • Akila,

    I have a couple of specific questions.

    1) What would cause the sequencer to never start running?

    2) What specifically causes the AFEINTSRC_ENDSEQ interrupt to fire? Only the call SEQ_STOP()?

    Thanks!

  • Hi,

    1) Sequence can be triggered either by register write as below:

    AD5940_SEQMmrTrig(AppIMPCfg.InitSeqInfo.SeqId); 

    where SeqId is the ID of the sequence you need to start.

    or

    by using wakeup timer. Wake up timer can be configured as below:

    if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
    return AD5940ERR_WAKEUP; /* Wakeup Failed */
    if(AppIMPCfg.IMPInited == bFALSE)
    return AD5940ERR_APPERROR;
    /* Start it */
    wupt_cfg.WuptEn = bTRUE;
    wupt_cfg.WuptEndSeq = WUPTENDSEQ_A;
    wupt_cfg.WuptOrder[0] = SEQID_0;

    wupt_cfg.WuptOrder[1] = SEQID_1;
    wupt_cfg.SeqxSleepTime[SEQID_0] = 4;
    wupt_cfg.SeqxWakeupTime[SEQID_0] = (uint32_t)(AppIMPCfg.WuptClkFreq/AppIMPCfg.ImpODR)-4;

    wupt_cfg.SeqxSleepTime[SEQID_1] = 4;
    wupt_cfg.SeqxWakeupTime[SEQID_1] = (uint32_t)(AppIMPCfg.WuptClkFreq/AppIMPCfg.ImpODR)-4;
    AD5940_WUPTCfg(&wupt_cfg);

    If wakeup timer is used, the sequence will start only after the previous sequence in the schedule is completed and sleep time has completed sleep timeout.

    2) Yes. Only the call SEQ_STOP() causes AFEINTSRC_ENDSEQ interrupt.

  • For the SWV example, can the register trigger work since the sleep timer is used to build an entire waveform with the ping-pong buffers? 

    Are there commands that can be used to clear the sequencer schedule and sleep timeout asynchronously? 

    How can I debug/monitor the state of progress of the sequencer and sleep timer so that a new waveform is not started prematurely?

    Thanks!

  • Yes. Register trigger can be done. In fact, the initialization sequence in SWV is triggered by register write: AD5940_SEQMmrTrig(AppSWVCfg.InitSeqInfo.SeqId); 

    Sequencer commands can be modified in runtime by updating the codes inside AppSWVRegModify() function.

    Timer configuration cannot be changed in runtime.

    The code uses GP0_PIN0, PIN1 and PIN2 as interrupt output, sleep indication and sampling indication respectively.

    gpio_cfg.FuncSet = GP0_INT|GP1_SLEEP|GP2_SYNC;  /* GPIO1 indicates AFE is in sleep state. GPIO2 indicates ADC is sampling. */

    You may monitor these pins on AD5940 to see the progress.