Skip to main content
Abhishek.gupta
Associate II
Jul 30, 2019 12:01 PM UTC
Question

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

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
Jul 30, 2019 12:29 PM UTC

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
Jul 30, 2019 12:38 PM UTC

 sConfigOC.Pulse = 10;

This is the configurations occurs after generating the code.

Bob S
Super User
Jul 31, 2019 3:21 PM UTC

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
Aug 1, 2019 12:12 PM UTC

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
Aug 1, 2019 4:07 PM UTC

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