Skip to main content
SWenn.1
Senior III
Jun 18, 2021 3:05 PM UTC
Solved

setting a register at bare metal layer??

I am using TIM1 in the STM32WB55. I used CubeIDE and HAL to set everything up. Based on a button push I would like to update the counter period to a value in an array. I prefer not to

		htim1.Init.Period = period[flag];
		HAL_TIM_Base_Init(&htim1);

as it seems silly to go through all the macros to re-init just for a register. Can someone tell me what is the syntax to just update the register itself?

Thanks

Steve

This topic has been closed for replies.
Mike_ST
Mike_STBest answer
ST Technical Moderator
Jun 18, 2021 3:24 PM UTC

Maybe TIM1->ARR = Period;

will do the job.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 

2 replies

Mike_ST
Mike_STBest answer
ST Technical Moderator
Jun 18, 2021 3:24 PM UTC

Maybe TIM1->ARR = Period;

will do the job.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
SWenn.1
SWenn.1Author
Senior III
Jun 18, 2021 4:19 PM UTC

Thanks Mike...

I believe that seems to work

Steve