Could you please let me know where you got your STM32L152 devices or board from. I do not seem to find any distributor here in the US for teh low power family. Thanks stmdesi
This next bit assumes a static variable called led_timer initialised to 0, that your LED is on port b and GPIO_LED is defined as the pin your LED is on.
Find TIM1_UP_IRQHandler() in stm32f10x_it.c and put the following code there :-
void TIM1_UP_IRQHandler(void)
{
TIM1_ClearITPendingBit (TIM1_FLAG_Update);
led_timer=1-led_timer;
if (led_timer)
GPIO_ResetBits (GPIOB, GPIO_LED);
else
GPIO_SetBits (GPIOB, GPIO_LED);
}
That should get you a timer interrupt ticking. Play with the Period and Prescaler to get it running at the right speed.
Sorry if it's a bit of a hack, I've taken it from bits of code I have and tied it together. Hopefully it will be enough to get you going.
Posted on May 17, 2011 at 14:11 Hi ANN and andy, If you want to use TIM4 instead of TIM1, there is some differencies: - TIM4 is on APB1 and not on APB2 - no repetition counter in TIM4 so no field TIM_RepetitionCounter in timer struct - interrupt handler is ''TIM4_IRQHandler'' and not ''TIM1_UP_IRQHandler'' That is what I have actually in mind. regards, MCU Lüfter
I have looked for the site dedicated to STM32L family and I diidn't find eval board documentation neither ST library. I have found only reference manual ,datasheet and 2 application notes. Perhaps STM32L152-EVAL isn't from ST. could you trell us where to find it in Germany ? Thanks ANN, Herzlich, MCU Lüfter