Generate pwm of 1Khz on s32k312

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Generate pwm of 1Khz on s32k312

1,475 次查看
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,460 次查看
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,451 次查看
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,446 次查看
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 项奖励
回复