cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S Missing Interrupt

TA1
Associate III

Dear all,

I am using STM8S103F2 in one of my design. I have two main missions in the code.

1- Convert analog signal into digital and do some action according to voltage level.

2- Catch an external interrupt in both falling and rising edges.

I realized microcontroller misses some of rising or falling edges even interrupt is enabled. Actually, it catches most of edges but it also misses. (ADC and EXTI are active.). Then I realized when EXT interrupt comes at the same time with ADC interrupt or when program is in the ADC ISR, EXTI is missed. (I added some debug features to the code. When ADC Interrupt comes one of outputs is set and when RETI from ADC ISR the output pin is cleared. Similarly, when EXTI is serviced, another pin is set and reset. I gave a signal from signal generator 500Hz and 10% duty cycle) I attached two screenshots from scope. Second graph is zoomed view of first graph. Yellow signal is taken from Port D pin 6 which is used for EXTI. Pink one is taken from one of output which is set and reset when ADC interrupt serviced and return from ADC ISR. Blue one is set and reset according to EXTI.

As far as I know from other microcontroller manufacturers that if two interrupts come at the same time, higher priority interrupt is serviced first then second will be serviced. I also read the user manual of STM8S. It explains concurrent and nested interrupt. My case is concurrent and it explains same an operation principle with other microcontrollers what I know. However practical result is not fit with theory. When I close ADC ISR in the code, all of rising and falling edge are driven EXT ISR without any missing edge.

Is there any one can explain how to solve this issue?

Thanks in advance

Regard

0690X000006CIrOQAW.bmp0690X000006CIrJQAW.bmp

2 REPLIES 2
TA1
Associate III

Is there anyone help me?

TA1
Associate III

Hi All,

The mystery is clarified by ST Tech Support. It is kind of hardware bug and please check Errata Sheet of STM8S103F2.

I used Port D as EXTI source and I also used ADC with interrupt. If I use PortA/B or C It wouldn't cause any problem but unlucky I used Port D.

Regards,