Skip to main content
mkari
Associate III
January 26, 2020
Question

Timer don't work when set ARR=0

  • January 26, 2020
  • 2 replies
  • 3154 views

Hi

When I want timer count (CNT register) until ​5000 for overflow , Set ARR = 5000-1; now I want timer count until 1 So I have to set value ARR = 1_1 (ARR = 0) But When Set ARR = 0 timer don't work and don't have interrupt. Why??

​how to set ARR For that evry input pulse one overflow interrupt??

Tanks

This topic has been closed for replies.

2 replies

berendi
Principal
January 26, 2020

The counter is "blocked" when ARR=0, this is explicitly stated in the reference manual (see the ARR register description).

You can use the trigger interrupt (TIM_DIER_TIE) instead.

mkari
mkariAuthor
Associate III
January 27, 2020

:backhand_index_pointing_down::backhand_index_pointing_down:

Tesla DeLorean
Guru
January 26, 2020

You can make the Prescaler smaller, to zero for no division. The period needs some range to work with.

Interrupting beyond a few hundred KHz is probably going to saturate the processor.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
mkari
mkariAuthor
Associate III
January 26, 2020

Tanks

I want ​to have a overflow interrupt

For every clack that comes into the CNT counter.

P​ay attention to pictur