Skip to main content
Abhishek.gupta
Associate II
July 30, 2019
Question

How the pulse value is used in the configuration of a timer as PWM generation.

  • July 30, 2019
  • 5 replies
  • 3013 views

0690X000009ZcXfQAK.jpg

Please tell me how this pulse value is used in the TIM->PWM Generation CHx.

How this value effect the Pwm generation.

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
July 30, 2019

Generate the code, then look into the code including Cube sources, to find out what registers in timer are affected. Probably the relatated TIMx_CCRy.

JW

Abhishek.gupta
Associate II
July 30, 2019

 sConfigOC.Pulse = 10;

This is the configurations occurs after generating the code.

Bob S
Super User
July 31, 2019

Now look into the HAL timer config function that you call and see what it does with the sConfigOC.Pulse value.

Abhishek.gupta
Associate II
August 1, 2019

uint32_t Pulse;     /*!< Specifies the pulse value to be loaded into the Capture Compare Register.

                 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */

This is the details i found there.

I have a confusion that the timer will reload from ARR register than where this pulse value effect the PWM signal generating from the timer.

I had done the following configuration but i am not able to judge the pulse value

clock=48Mhz

Prescaler=24

ARR=100

Please let me know what i have to do with this pulse value.

waclawek.jan
Super User
August 1, 2019

Well, you've found out that the pulse value is loaded into the Capture Compare Register (TIM_CCRx). Reading the timer chapter in Reference Manual certainly reveals details on what is the purpose of this register.

JW