Skip to main content
Visitor II
January 1, 2026
Question

STM8S103f3 interrupt

  • January 1, 2026
  • 1 reply
  • 36 views

Dear ST team,

 

STM8S103f3   I need to initialize interrupt but how I can define particular pin of the port for interrupt .

Or how to initialize two interrupt in one port.

please share example or library 

Glodhi_0-1767244137138.png

 

 

RM0016

Glodhi_1-1767244178968.png

thanks and regards

Guddu

 

 

    This topic has been closed for replies.

    1 reply

    Visitor II
    January 2, 2026

    See RM0016 page 109, section 11.7.2 - Interrupt capability.

    Code example for pin PA7:

    EXTI_CR1 |= 0x01;	// Rising edge only
    PA_DDR &= 0x7F;		// PA7 is input
    PA_CR2 |= 0x80;		// enable interrupt on PA7
    _asm("rim");		// Enable global interrupts

    In Interrupt vector table, put the address of your interrupt handler in EXTI0 entry.

    You can't have two interrupt pins on same port because you can't know which pin generated the interrupt. Use two ports.

     

    GlodhiAuthor
    Visitor II
    January 2, 2026

    for different interrupt pins need to use different port what if i use PC3 and PC4 two different interrupt on one port then 

    i can't be able to identify interrupt ?
    can you share example code for this PC3 or pC4 if not  then share 

    example for different port