[NECTO Studio 2.1.0: Timer Calculator] STM32F4xx: Wrong reload value setting for timer 2

Timer Calculator is a free software development tool used for easier calculation of timer interrupts.
Post Reply
Author
Message
frank.malik
Posts: 96
Joined: 09 Apr 2021 20:37

[NECTO Studio 2.1.0: Timer Calculator] STM32F4xx: Wrong reload value setting for timer 2

#1 Post by frank.malik » 21 Sep 2022 12:05

Hello,

tried to get a 1ms interrupt on the Fusion v8 for STM32 board.
Using the timer calculator I got the following settings:
TimerCalculator_STM32F4xx_168MHz_timer2_1ms.png
TimerCalculator_STM32F4xx_168MHz_timer2_1ms.png (18.69 KiB) Viewed 611 times

However, with this setting I got a 2ms interrupt.

Code: Select all

168MHz / 2 = 84MHz
PSC is 2, means the division is by 3.

Code: Select all

84MHz / 3 = 28MHz
ARR is set to 56000-1

Code: Select all

28MHz / 56000 = 500Hz, means 2ms interrupt cycle.
Either setting ARR to 28000-1, or setting PSC to 1 and ARR to 42000-1 will give the correct results.
Attachments
Test_Millis_Settings.zip
(3.01 KiB) Downloaded 32 times
Kind regards
Frank

Fusion for STM32 v8, STM32F407ZG@168MHz, 4" TFT capacitive
mikromedia 3, PIC32MZ2048EFH100@200MHz, 3" TFT capacitive
NECTO Studio 3.0.0, mikroC AI for ARM/PIC32, mikroSDK v.2.7.2

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: [NECTO Studio 2.1.0: Timer Calculator] STM32F4xx: Wrong reload value setting for timer 2

#2 Post by filip » 10 Oct 2022 15:27

Hi,

Thank you for reporting this, I have passed this to our development team.

Regards,
Filip.

Post Reply

Return to “Timer Calculator”