Skip to main content
GSant.5
Associate
June 4, 2021
Question

Question on 'pulse' section is stm32Cube

  • June 4, 2021
  • 3 replies
  • 894 views

hello everyone, I am trying to generate a square wave at a desired frequency. I am supposed to use the TIM3 peripheral. I selected the "Output compare CH1" for channel 1 section and under this section it asks me for a pulse value (which I know is the content of the CCR1 (capture compare register) my question is, if I modify the content of the CCR1 register in the generated code will the STM32Cube application ignore this action and still take the pulse value provided earlier? or will it modify?

This topic has been closed for replies.

3 replies

TDK
June 4, 2021

The pulse value isn't used after initialization. Changing CCR1 will change the duty cycle. Changing ARR or PSC will change frequency.

"If you feel a post has answered your question, please click ""Accept as Solution""."
GSant.5
GSant.5Author
Associate
June 4, 2021

okay thanks but if I change ARR does that mean that the original value of the "counter period" that i set earlier in the software will be changed?

TDK
June 4, 2021
Itwont change your initialization array, but the effect will be the same.
"If you feel a post has answered your question, please click ""Accept as Solution""."