2020-12-07 01:20 AM
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
2020-12-25 11:14 PM
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.
2020-12-25 11:51 PM
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 .
2020-12-26 12:42 AM
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.
2020-12-26 02:05 AM
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 .