How can I access registers directly? #2310
-
I am trying to access HW registers directly, for example Timer 2 If I write
I get
but, when I use API functions first, like
I get
Now I also can assign custom values to the registers directly... Do I have to "activate" the TIM2 register variable somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @MasteringTheMess
|
Beta Was this translation helpful? Give feedback.
-
A very good guess, indeed :) That did the trick, thank you. can also be achieved by configuring the register directly:
|
Beta Was this translation helpful? Give feedback.
-
the corresponding information is also in the datasheet, but not at the peripheral register description. |
Beta Was this translation helpful? Give feedback.
Hi @MasteringTheMess
As a first guess, I would recommend to enable the clock
__HAL_RCC_TIM2_CLK_ENABLE();