Question
How to correctly set up a micro second timer?
Hi there.
I know this question is already asked, but the topics I've read didn't worked for me, so I'm writing this in order to study mi concretely case.
I'm setting up my timer using TIM1 with the next parameters:
//Prescaler for 1 us
uint32_t PrescalerValue = (uint32_t)(apb1clock / 1000000) - 1;
//Other parameters
timer_us_timhandle_.Init.Period = 1 - 1;
timer_us_timhandle_.Init.Prescaler = PrescalerValue;
timer_us_timhandle_.Init.ClockDivision = 0;
timer_us_timhandle_.Init.CounterMode = TIM_COUNTERMODE_UP;Where apb1clock is 9 MHz.
Am I doing wrong? Maybe a concept problem?
The result I'm having is that main line of code execution cannot go on because of the continous ISR calling. Am I overweighting my STM? (STM32F105VC).
P.S.: After the ISR call I set the flag to 0.
Thank you in advance.
