Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I configure an interrupt for a GPIO pin on a STM32F103ZE chip?

Is there any GPIO interrupt available for STM32F103ZE? I went through the datasheet but didn't find anything related to that. I am new to this processor but recently used TI's MSP430. In MSP430 we can configure interrupts using some GPIO registers. Can anybody tell me how can I do that?

like image 219
Harikrishnan Avatar asked Jan 19 '23 02:01

Harikrishnan


1 Answers

Yes.

Please refer to the datasheet:

Section 8.1.3 states:

External interrupt/wakeup lines

All ports have external interrupt capability. To use external interrupt lines, the port must be configured in input mode. For more information on external interrupts, refer to:

  • Section 9.2: External interrupt/event controller (EXTI) on page 174 and
  • Section 9.2.3: Wakeup event management on page 175.

If you check out section 9.2.5 you'll find that you have to set up the external interrupt peripheral (EXTI) in order to map the pins you want to observe into the correct interrupt.

Re-read sections 8 and 9 of the data sheet, and make certain you understand how each EXTI register needs to be setup to listen on the correct GPIO lines, and to trigger on the correct type of transition.

like image 63
Adam Davis Avatar answered Jan 30 '23 07:01

Adam Davis