This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Altering blinky?

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

Parents
  • I don't work with your processor so I haven't checked exactly where timer4 gets its input frequency from.

    But note that 10000 is a very small divisor. If timer4 gets run at 10MHz (just an example), then you would only manage to divide down to 1kHz which is faster than you can see when watching the LED.

    Have a closer look in the datasheet about clock sources and prescaler options for your timer. I think you are running it at a way higher frequency than you think.

Reply
  • I don't work with your processor so I haven't checked exactly where timer4 gets its input frequency from.

    But note that 10000 is a very small divisor. If timer4 gets run at 10MHz (just an example), then you would only manage to divide down to 1kHz which is faster than you can see when watching the LED.

    Have a closer look in the datasheet about clock sources and prescaler options for your timer. I think you are running it at a way higher frequency than you think.

Children
  • But I'm using the configuration wizard. It says: TIM4 period[us]. So i figured that this means that an interrupt is generated automatically every 10000us, but this is not the case? I actually tried using the detailed settings where i prescaled with 7200 and set the counter reload value to 100 but with the same results.