cancel
Showing results for 
Search instead for 
Did you mean: 

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

Abhishek.gupta
Associate II

0690X000009ZcXfQAK.jpg

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

How this value effect the Pwm generation.

5 REPLIES 5

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

 sConfigOC.Pulse = 10;

This is the configurations occurs after generating the code.

Bob S
Principal

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

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.

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