Pwm period and dutycycle

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

Pwm period and dutycycle

跳至解决方案
2,069 次查看
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 解答
2,041 次查看
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

在原帖中查看解决方案

3 回复数
2,042 次查看
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

2,011 次查看
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?
1,980 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

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

BR, Petr

 

0 项奖励
回复