Generate pwm of 1Khz on s32k312

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

Generate pwm of 1Khz on s32k312

1,471件の閲覧回数
Sjoshi11
Contributor I

I am trying to generate pwm output with 1 Khz and variable duty cycle using Emios for fan control. 

When I try to configure pwm module it is showing pwm period in ticks. How many ticks should I use for generating 1Khz pwm? Clock for Emios is used as 120Mhz

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

1,456件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@KVP

Assuming no division of the clock is done

eMIOS CLOCK->120Mhz

1S -> 120Mhz(120 000 000 ticks)

1Khz = (1/1000)S ->120000000 * (1 / 1000) = 120000 ticks

 but the max tick is 65534

0 件の賞賛
返信

1,447件の閲覧回数
Sjoshi11
Contributor I

I did the same calculation but since tick count in exceeding max value so not able to use this 120000 value. Also, if I try to deselect tick and try to enter value in seconds, it is giving me error " The channels use counter bus that only support in ticks unit."

0 件の賞賛
返信

1,442件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@KVP

You already know how to calculate.

In this case, you need to divide the emios clock source so that the tick value does not exceed 65534.

0 件の賞賛
返信