Question
Timer Interrupt frequency influenced by WFE
Posted on October 29, 2012 at 02:03
Dear readers,
the attached program for the STM32F407VGT6 (on the STM32F4 Discovery) should generate an interrupt every 500ms. The ISR toggles GPIO pin D14, which lets the LED (red) connected to it blink with 1Hz. The infinite loop in the main() function should also toggle D12 very fast, but the LED (green) connected to it stays dark. When removing line 60 (the __WFE instruction), the frequency on D14 drops to 1/4 Hz, and the LED on D12 is dimly lit, as expected with this simple form of 50% PWM. Why does D12 stay low when using WFE, and why does the frequency on D14 change when not using WFE? I am using the toolchain, the linker script and startup code from the ST examples for the Atollic Studio IDE, CMSIS and the STM32F4xx Standard Peripherals Library V1.0.2. Thank you very much in advance!