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?
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.
精彩评论