cancel
Showing results for 
Search instead for 
Did you mean: 

Question on 'pulse' section is stm32Cube

GSant.5
Associate II

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?

3 REPLIES 3
TDK
Guru

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
Associate II

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?

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".