cancel
Showing results for 
Search instead for 
Did you mean: 

how can i clear the pending external interrupts in STM8s003k3

Trinu
Associate III

Here I am using the STM8s003k mcu .

In my application,I am configuring the external interrupts for a port .

after rising the interrupt how can I clear that interrupt.

If I can not clear that interrupt the external interrupt handler only will execute.

I am not able to execute another functions .

please tell me how to clear the pending external interrupts

4 REPLIES 4
Cristian Gyorgy
Senior III

Hi!

In STM8S003 there is no EXTI_SR, and you don't need to clear any external interrupt flag, it is automatically cleared when jumping to the vector.

If your code is executing continuously the interrupt handler, it means that the interrupt is triggered too often or the interrupt mode is not right - i.e. low level active and you have a low level on the pin. In such a case you could temporary disable the interrupt inside the interrupt handler, until you find out what is the problem.

Trinu
Associate III

Hi!

this is my interrupt configuration

void EXTI_Config(void)

{

EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOC,EXTI_TLISENSITIVITY_RISE_ONLY);

 enableInterrupts();

}

And this is my gpio configuration

void GPIO_Config(void)

{

 /* Initialize OUTPUT PINS */ 

GPIO_Init(GPIOC,GPIO_PIN_3,GPIO_MODE_IN_PU_IT);

}

here I am getting voltage 3.6v at that particular pin 3 which is configured for the exti interrupts.

but I am not giving any input to that pin.

when I change the configuration as flaot mode at this moment I am getting approximately 2v.

I don't understand the problem what is in circuitry.

GPIO configuration mode can effect the external interrupts?

Thanks .

Cristian Gyorgy
Senior III

Well, why do you change it to float? This is why you get the random/continuous interrupts. Float it means there is no defined level, it floats, so it can freely oscillate close to the trigger level, and this is causing the many interrupt triggering you see.

Keep the pull-up active, unless you have other circuitry to drive the port pin to a defined level.

In pull up mode also getting the same continuous interrupt then I change mode and just tried in float mode .

after that I changed the mode also I would get same thing.

when I configure the pull-up mode at that pin I got 5V Dc voltage .

whit out applying input to that particular pin .