cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4-discovery timer question

michael239955
Associate III
Posted on November 25, 2013 at 02:30

I am using a discovery kit to evaluate some timer functions. I need to time a data packet send/receive. So, I would like to use one of the timers for this. My plan is to send the last byte of the data packet out a USART and then start a 40ms timer. In the meantime I have to continue processing other data so I can't just simply delay for ''some ms'' waiting for a response from the packet just sent. As soon as I enable TIM2 interrupts in the NVIC the

TIM_IT_Update interrupt fires. Is this normal?

1 REPLY 1
Posted on November 25, 2013 at 15:48

Is this normal?

Yes, the Update is a Zero/Reset event, so unless you clear pending interrupt it's likely to interrupt when you enable it.

Not sure I understand your approach here, I'd be tempted to free run the timer and pull timestamp values at the points you want to measure, and compute a delta (difference) between them. If it's just a matter of marking time, have SysTick provide a 1ms (or whatever) timebase and have a task flag or start the next transfer every 40.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..