AnsweredAssumed Answered

STM32F0 External Interrupt Issue

Question asked by Mike Thomas on Oct 16, 2017
Latest reply on Oct 16, 2017 by Mike Thomas

Hello All.


I am new to STM32F microcontrollers, though I have worked with Freescale/NXP Kinetis ARM processors for quiet a few years.


I am trying to get and external interrupt  (on port C bit 13) to work on a 48 pin STM32F091 MCU.

A push button is pulled up with an external 10k ohm resistor. Pushing button pulls Port C13 to ground.


Here is what I am doing...




void init( void )

// Enable Port C clock



// Connect PORTC bit 13 to EXTI13



// Interrupt on falling edge



// Unmask EXTI interrupt



// Set EXTI4_15 irq to priority 2

NVIC_SetPriority( EXTI4_15_IRQn, 2 );


// Enable EXTI4_15 IRQ in NVIC

NVIC_EnableIRQ( EXTI4_15_IRQn );


// Enable global interrupts







void EXTI_4_15_Handler( void )



         if( EXTI->PR & EXTI_PR_PR13 )         // EXTI 13 occur?


               EXTI->PR |= EXTI_PR_PR123;      // If so, clear pending bit

               cout('*');                                             // Show a * on console





My main loop code polls GPIOC->IDR for a valid push button closure, and when pushed, the bit in the IDR reads 0 (1 otherwise), however, the ISR never executes.


When I simulate an external interrupt by setting bit 13 in the EXTI->SWIER |= EXTI_SWIER_SWIER13,, the ISR executes, printing a '*' on the console.

I have read in the STM32F0 reference manual that Port C13 is also part of the RTC domain, but it does not appear that PC13 plays any part in the RTC.


What could possibly be wrong?


Thanks in advance