We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hey people.
I'm quite new to this microprocessor business and i'm having a problem. I'm currently using the MCBSTM32 kit with the cortex M3 and i'm looking at the example blinky. In the program i intend to make I have to use the timer 4, so i figured i'd alter the blinky so that the interupt is caused by the timer 4 instead of the systick. The clocks are set the same way, and the period of timer4 is set to 10000u, and i have enabled the "update interrupt, but it doesent work. The leds switch way to fast. They are pretty muck on all the time, the only difference is that they sort of flicker a bit. Does anyone know the explanation for this. Any help would be much appreciated. Cheers Rasmus
Hello Rasmus Bunkenborg,
if you are using Timer4 Update Interrupt than your ISR should look like:
void TIM4_IRQHandler(void) { if (TIM4->SR & (1<<0)) { // UIF set? /* Add you code here */ TIM4->SR &= ~(1<<0); // clear UIF flag } }
Best Regards, Martin Guenther
So its because you have to clear the interrupt flag manually or whats the deal. It seems to work. THANK YOU! If you ever are in the the neighboorhood(that being Odense, Denmark), i will buy you a beer;) Cheers Rasmus
Sorry, I thought 10000u was to signify an unsigned constant instead of a 10000us time. It wasn't clear from your original post that you were using the configuration wizard.