AnsweredAssumed Answered

GPIO interrupt latency seems long

Question asked by dubd on Dec 11, 2013
Latest reply on Jan 20, 2014 by VineethaThomas

I am measuring ~375ns from the rising edge of an interrupt signal on a GPIO to the toggling of another GPIO at the first instruction inside the ISR. The code is given below. Main does nothing other than set the clocks and GPIO registers, then enable the interrupt in question.

 

bf527

CCLK = 600Mhz

SCLK = 120Mhz

 

In another thread I read the latency should be closer to 80ns. What could be causing mine to be 4 times longer?

 

 

void main(void)
{

    /* Driver / servies return values */
    ADI_PWR_RESULT pwrResult;

    adi_initComponents();

    // -------------------------------------------------------------------------
    // CONFIGURE clocks
    /* initialize the power service with the clock limit values */
    pwrResult = adi_pwr_Init(CLKIN, CORE_MAX, SYS_MAX, VCO_MIN);
    checkResult(pwrResult, __FILE__, __LINE__);
    /* set the core clock and system clock values */
    pwrResult = adi_pwr_SetFreq(MCLK_FREQ_MHZ * MHZTOHZ, SCLK_FREQ_MHZ * MHZTOHZ);
    checkResult(pwrResult, __FILE__, __LINE__);

    // -------------------------------------------------------------------------
    // CONFIGURE GPIOs
    *pPORTGIO_DIR = (_LED1_BIT | GPIO4_BIT);
    *pPORTGIO_INEN = (PPS_OUT_BIT);
    *pPORTGIO_EDGE = (PPS_OUT_BIT);
    *pPORTGIO_MASKA_SET = (PPS_OUT_BIT);
    // set to IVG7 so this interrupt has higher priority
    if (adi_sic_SetIVGLevel(ADI_SID_PORTG_INTA, 7) != ADI_SIC_SUCCESS)
    {
        ErrorPrint();
    }
    if (adi_int_InstallHandler(ADI_SID_PORTG_INTA, gpioGIsr, NULL, false)   != ADI_INT_SUCCESS)
    {
        ErrorPrint();
    }

    if (adi_int_EnableInt(ADI_SID_PORTG_INTA, true)   != ADI_INT_SUCCESS)
    {
        ErrorPrint();
    }

    while(1);

     return;
}

void gpioGIsr(uint32_t SID, void *pCBParam)
{
     GPIO4_TOGGLE;
    *pPORTGIO_CLEAR = PPS_OUT_BIT;        // clear interrupt
}

Outcomes