S32K344 hardware PWM frequency

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

S32K344 hardware PWM frequency

Jump to solution
3,950 Views
sorozatgyilkos
Contributor II

Hello everyone!

Me and my team are working on a high power battery charger (OBC) and we would require a 100 kHz hardware PWM. Based on the S32K344 datasheet, only 20 kHz and 400 Hz is mentioned.

Is it possible to adjust the hardware PWM's frequency to 100 kHz or other arbitrary frequencies? If so, how?

Thank you in advance!

Greetings,
Peter

0 Kudos
Reply
1 Solution
3,934 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes 100Khz frequency is possible.
eMIOS module is available for PWM signal generating, using PWM modes (OPWMB, OPWFMB, ...)
eMIOS is clocked from CORE_CLK (up to 160Mhz). eMIOS divides this clock by the global prescaler (MCR[GPRE] + 1) and routes the resulting prescaled clock output to the channel internal prescaler (Cn[UCPRE] + 1). Thus channel internal counter counts (CORE_CLK/global prescaler/internal prescaler) clock.
Finally assuming channel running in e.g. OPWFMB mode, its PWM frequency is calculated as

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

B1 is a value written to channel B register.

Refer to device RM for description of eMIOS modes.

BR, Petr

View solution in original post

5 Replies
3,935 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes 100Khz frequency is possible.
eMIOS module is available for PWM signal generating, using PWM modes (OPWMB, OPWFMB, ...)
eMIOS is clocked from CORE_CLK (up to 160Mhz). eMIOS divides this clock by the global prescaler (MCR[GPRE] + 1) and routes the resulting prescaled clock output to the channel internal prescaler (Cn[UCPRE] + 1). Thus channel internal counter counts (CORE_CLK/global prescaler/internal prescaler) clock.
Finally assuming channel running in e.g. OPWFMB mode, its PWM frequency is calculated as

PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)

B1 is a value written to channel B register.

Refer to device RM for description of eMIOS modes.

BR, Petr

760 Views
anakha
Contributor III

Hi @PetrS 

How we could define B1 in RTD

0 Kudos
Reply
3,917 Views
sorozatgyilkos
Contributor II

Just a quick question, just checked the reference manual now, and it mentions 72 standard channels for emios, does this mean that we can have 72 individual PWM outputs in theory?

0 Kudos
Reply
3,898 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

unfortunately not, you need to consider possible modes implemented in each channel, which is stated in Chip-specific eMIOS information chapter of the RM. Some channels does not include internal counter so must run out of other counter bases (global or local), which must be generated by channel running in MCB/MC modes. There are 5 counter busses, for those channels not having internal counter, so this also limits number of channels with individual PWM frequency.

BR, Petr

3,924 Views
sorozatgyilkos
Contributor II

Thank you very much Petr!

0 Kudos
Reply