Skip to main content
Visitor II
June 4, 2021
Question

Question on 'pulse' section is stm32Cube

  • June 4, 2021
  • 2 replies
  • 870 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.

    2 replies

    Super User
    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.

    GSant.5Author
    Visitor II
    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?

    Super User
    June 4, 2021
    Itwont change your initialization array, but the effect will be the same.