Pwm period and dutycycle

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

Pwm period and dutycycle

Jump to solution
667 Views
HBH
Contributor II

Hi

I was working on NXP s32k324 controller .

Need to run a PWM at 100Hz and 125Hz .

I am using core clock 160mhz as input to pwm, and emios_ch_prescala is configured to emios_pwm_ip_clock_div_16.how to achieve this? If we configure EMIOS_PWM_IP_PS_SRC_PRESCALED_CLOCK as prescalar source where to give global prescalar? Is it emios_ch_prescalar alternative? 

Period In Ticks: Valid range: [0, 65534]

1 Solution
639 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

global prescaler is defined in MCL component, see below pictures for LLD and HLD drivers in S32DS ConfigTool

PetrS_0-1688470090021.pngPetrS_1-1688470105289.png

BR, Petr

View solution in original post

3 Replies
640 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

global prescaler is defined in MCL component, see below pictures for LLD and HLD drivers in S32DS ConfigTool

PetrS_0-1688470090021.pngPetrS_1-1688470105289.png

BR, Petr

609 Views
HBH
Contributor II

using EmiosChMode as EMIOS_PWM_IP_MODE_OPWFMB since we have to get variable period and variable duty and EmiosChCounterBus as EMIOS_PWM_IP_BUS_INTERNAL.
while configuring EmiosChPrescalerSource as EmiosChPrescalerSource and PwmEmiosBusRef as /Mcl/Mcl/MclConfig/EmiosCommon_0/EmiosMclMasterBus and in mcl EmiosMclClkDivVal is configured as 2, getting error as "When using EMIOS_PWM_IP_BUS_INTERNAL, PwmEmiosBusRef is not needed"

  • should we needed to select PwmEmiosBusRef as /Mcl/Mcl/MclConfig/EmiosCommon_0/EmiosMclMasterBus inorder to achieve 100hz?
  • what all configuration is needed to achieve 100hz?
578 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

so remove PwmEmiosBusRef from channel config and take EmiosMclClkDivVal as global prescaler in calculation.

BR, Petr

 

0 Kudos