Generate pwm of 1Khz on s32k312

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generate pwm of 1Khz on s32k312

682 Views
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 Kudos
Reply
3 Replies

667 Views
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 Kudos
Reply

658 Views
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 Kudos
Reply

653 Views
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 Kudos
Reply