PWM not generating for s32k324

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

PWM not generating for s32k324

跳至解决方案
4,538 次查看
HBH
Contributor II

PWM not generating for s32k324 emios_0 channel 4 and emios_0 channel 5. given settings as below 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. in mcl EmiosMclClkDivVal is configured as 2, Channel class as variable.

Registers for emios_0 A4, B4 and A5, B5 are being set as per the configuration, but PWM wave form is not generating

0 项奖励
回复
1 解答
4,489 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

well, UCOUT is toggling, so OPWFMB works normal.
Then check pin setting and be sure you measure right pin.
Picture names point to 48, is that GPIO48 (PTB16) pin and so controlled by MSCR48?
Because in port setting you have PCR value 36 that is PTB4 pin, also configurable for eMIOS_0 ch4.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
6 回复数
4,514 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

try to check eMIOS register setting in debugger. To know global prescaler and internal prescaler are enabled and channel counter is running. You can also check An, Bn register setting. Sn[UCOUT] indicates the output pin state, so if it is toggling, then most probably your pin setting is not correct.

BR, Petr

0 项奖励
回复
4,508 次查看
HBH
Contributor II

given pwm duty cycle is 50%, Value for register A4 and B4 are being set accordingly. attaching the screen shot for the same.  

0 项奖励
回复
4,501 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

this looks normal. Counter seems to be running as flag is set. Mode is OPWMB.
Do you see UCOUT also change value? What about OUDIS register, if set for channel bit, clear it.

BR, Petr

0 项奖励
回复
4,499 次查看
HBH
Contributor II

HBH_0-1689331206673.png

the mode i have set is OPWFMB, sharing the updated register snapshot

attaching the screen shot for configuration details also

0 项奖励
回复
4,490 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

well, UCOUT is toggling, so OPWFMB works normal.
Then check pin setting and be sure you measure right pin.
Picture names point to 48, is that GPIO48 (PTB16) pin and so controlled by MSCR48?
Because in port setting you have PCR value 36 that is PTB4 pin, also configurable for eMIOS_0 ch4.

BR, Petr

0 项奖励
回复
4,481 次查看
HBH
Contributor II

its PTB4 and is controlled by MSCR36 and selected eMIOS_0 ch4 as mode. attaching the snapshot for same

0 项奖励
回复