2020-01-23 01:18 PM
Hi
I make a 32 bit timer by to 16 bit timer3(master) & timer4(slave)
Now I want my timer count antil 150000 (for example)
How to get 150000 in two TIM3->ARR & TIM4->ARR register??
Does it have a special formula?
this number (150000) isn't fixed.
I have a lot of 32 bit different number that they sound set for my 32 bit timer (TIM3->ARR & TIM4->ARR). So I have to use a function that set TIM3->ARR & TIM4->ARR value Given different input numbers
Tanks
2020-01-23 01:25 PM
Just factor the number in any arbitrary way, and don't forget, that the period is ARR+1; eg.
TIM3->ARR = 1000 - 1;
TIM4->ARR = 150 - 1;
Sometimes the particular usage requires that one of the timers has as high ARR as possible. For example, you'll find that reading the "current value" of such "32-bit" counter is tricky and you'll need to read master-slave-master and check if master did not roll over meantime; and to decrease the probability of rollover you'll want to minimize the slave's count frequency thus maximize master's ARR, i.e.
TIM3->ARR = 50000- 1;
TIM4->ARR = 3 - 1;
JW
2020-01-23 02:34 PM
Tanks
But this number isn't fixed.
I have a lot of 32 bit different number that they sound set for my 32 bit timer (TIM3->ARR & TIM4->ARR). So I have to use a function that set TIM3->ARR & TIM4->ARR value Given different input numbers
2020-01-23 03:16 PM
https://en.wikipedia.org/wiki/Integer_factorization
of which the simplest is https://en.wikipedia.org/wiki/Trial_division
etc.
You may be out of luck, if your number is prime, or if its largest factor is >65535.
JW
2020-01-24 11:29 PM
you can use master-slave configuration
2020-01-25 01:18 PM
I'm guessing, but are you trying to implement software timers to trigger different actions after milliseconds, seconds, minutes, hours, days...? Those are typically done with SysTick or another single hardware timer, doing the rest of the job in software with a sorted linked list.
2020-01-25 10:49 PM
Hi
Thanks for the guidance
No, I need 3 32bit timer.
I used master slave configuration but my problem is arr value in mixed timer
2020-01-26 08:20 AM
Can you describe your intended use case of 32-bit timers in more details? What exactly will those do in your project?
2020-01-28 02:32 AM
which controller you are using , in controller is there any 32 bit timer available or not ? first check
2020-01-28 02:33 AM
.