Skip to main content
joybox2007
Associate
Jul 1, 2018 7:32 PM UTC
Question

STM8S103F external interrupt

Posted on July 01, 2018 at 21:32

Hi!

I use a STM8S103F and I need to process external interrupts on PINs2,3 of PORT D by both fronts. That's my initialization code:

GPIO_Init(GPIOD, GPIO_PIN_2 | GPIO_PIN_3, GPIO_MODE_IN_PU_IT);

EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOD, EXTI_SENSITIVITY_RISE_FALL);

enableInterrupts();

The problem is when I connect one of this pins to the ground the program goes to interrupt function and don't leave it while I don't release the pin. What I did wrong?

    This topic has been closed for replies.

    2 replies

    henry.dick
    Associate II
    Jul 3, 2018 12:12 PM UTC
    Posted on July 03, 2018 at 14:12

    1. somehow it went from edge triggered to level trigger?

    2. faulty switch?

    3. status flag not cleared?

    ...

    joybox2007
    Associate
    Jul 5, 2018 4:48 PM UTC
    Posted on July 05, 2018 at 16:48

    1. Yes, it's look like level trigger (low level). But I use flag 

    EXTI_SENSITIVITY_RISE_FALL so I don't understand how it might be.

    2. F

    aulty switch is impossible because of I use a jumper to short pin to ground. 

    3. I did't find in reference manual any status flags to be cleared in STM8S (only in STM8L)

    The problem is still did't solved.