PWM period

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
rvanspaa
Posts: 11
Joined: Mon Apr 24, 2017 7:51 am

PWM period

Post by rvanspaa »

Hi,

There is a "period" in PWMDriver and also in PWMConfig. Could someone please explain why there are two, and if they are different, what the difference is, and why there is none in PWMChannelConfig?

Regards,

rvanspaa
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: PWM period

Post by Giovanni »

Hi,

The one in PWMDriver is an internal variable, the one in PWMConfig is the period you set initially.

Channels do not have their own period because all channels share the same period.

Giovanni
rvanspaa
Posts: 11
Joined: Mon Apr 24, 2017 7:51 am

Re: PWM period

Post by rvanspaa »

Hi Giovanni,

Thanks for the explanation, but I'm afraid it just leaves me with more questions. Could you please define "channel", and explain it's association with pins?

Regards,

rvanspaa
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: PWM period

Post by Giovanni »

Hi,

Channels are explained in the STM32 Reference Manual, see TIMx chapters. Pin associations are documented in the STM32 data sheet.

Giovanni
rvanspaa
Posts: 11
Joined: Mon Apr 24, 2017 7:51 am

Re: PWM period

Post by rvanspaa »

Hi Giovanni,

Thanks.
Post Reply