K64F PWM with long period

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K64F PWM with long period

558件の閲覧回数
kevinyuthermo
Contributor III

I need a PWM signal with a two-second period.

FTM module has the PWM function but the PWM period too short (us level) since it uses a 16 bits counter.

How can I get a second level period PWM? Or I have to implement it with timer on a GPIO?

0 件の賞賛
4 返答(返信)

423件の閲覧回数
mjbcswitzerland
Specialist V

Hi Kevin


Choose a low frequency clock for the FlexTimer if possible and use maximum pre-scaler too; this will give you longer periods for the PWM period.

You can also use an external clock which allow even slower clocks.

It is also possible to use two FlexTimers (cascaded) - the first generating a slow clock for the second (this can also be cascaded via the FlexTimer clock input).

Regards

Mark


uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html

0 件の賞賛

423件の閲覧回数
kevinyuthermo
Contributor III

Hi Mark,

I can make a second-level timer, but I have to implement the pwm duty cycle update algorithm. That introduces more work. Any better simple solutions? 

0 件の賞賛

423件の閲覧回数
mjbcswitzerland
Specialist V

Hi

That is the only and simplest solution I can think off - a duty cycle update algorithm is a calculation of a value to write to the corresponding FTM_CV register and will not be made more complex with a slower or a two-tiered clock.

Regards

Mark

0 件の賞賛

423件の閲覧回数
kevinyuthermo
Contributor III

Hi Mark,

Do you have some sample code about using two FlexTimers (cascaded) - the first generating a slow clock for the second (this can also be cascaded via the FlexTimer clock input).?

 

0 件の賞賛