AnsweredAssumed Answered

[Silicon bug?]STM8AF5286 missed external interrupts

Question asked by marton.miklos on May 24, 2017

During a recent development I have noticed a strange issue which makes me think that the external interrupt is not executed for every edge.

 

I have generated low impulses with an STM32 with increasing pulse width from 10ns with 10ns step (10ns, 20ns, 30ns....)

 

I have created two test case to verify this issue. In both test cases the same configuration (MCU, generated pulses) were used, just the code had been changed between the two tests.

 

In the first test case the input pin was read in a main loop and copied to an another. No ISR was enabled.

 

while (1) {

     TRIGGER = PB_IDR_bits.IDR0;
}

 

 

The code reliably detects pulses longer than 890ns, but also capable of reading port states in much shorter impulses.

 

But if I perform the same task with an empty while(1) {} main loop with the following ISR code I got slightly different results. The interrupts are configured to trigger interrupts on both edges (EXTI_CR1 = 0b00001100; // using external ISR on PORTB both edges).

 

/**
  * @brief  External Interrupt PORTB Interrupt routine
  * @param  None
  * @retval None
  */

INTERRUPT_HANDLER(EXTI_PORTB_IRQHandler, 4)
{
    TRIGGER = PB_IDR_bits.IDR0;
}

 

I get the following:

 

The first detected pulse is 950ns wide and it detects reliable pulses longer than 1.350 us.

 

We have planned to create a CAN based logic analyzer like tool with this MCU, but it turned out we are loosing edges because of this issue.

 

I would deeply appreciate if someone from the ST would comment on this matter. The minimum external interrupt triggering pulse length does not mentioned anywhere in the docs, but I might missed it.

Outcomes