TEJASWINI YELGUDKAR
TEJASWINI YELGUDKAR

Reputation: 11

how to assign 20 interrupts as only 16 lines can be configured as EXTI lines?

i'm using stm32f091xc controller where i want to configure 20 GPIO lines as EXTI lines with rising_falling edge.How can i configure these 20 lines, as only 16 gpio lines can be configured as EXTI lines?

Upvotes: 0

Views: 309

Answers (2)

You have to find 4 pins that can somehow be programmed to behave like EXTI sources. Some ideas:

  • UARTS can generate an interrupt on CTS state changes.
  • Timers can count state changes of their input lines. With an auto reload value of 1, they should generate an interrupt on every event.
  • Comparator inputs

Upvotes: 1

user149341
user149341

Reputation:

You can't. There are only 16 external interrupts1, and each one can only be mapped to one GPIO.

You will need to either:

  • Poll for events on some or all of these GPIOs instead of using interrupts.

  • Find a way to aggregate events on some of these GPIOs in external hardware, e.g. by ORing together certain inputs.

  • Use an IO expander to handle some or all of these inputs.


1: Technically, there are another 16 EXTIs, but they're all used for internal events and won't help you here.

Upvotes: 1

Related Questions