PWM not generating for s32k324

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

PWM not generating for s32k324

Jump to solution
4,540 Views
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 Kudos
Reply
1 Solution
4,491 Views
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

View solution in original post

0 Kudos
Reply
6 Replies
4,516 Views
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 Kudos
Reply
4,510 Views
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 Kudos
Reply
4,503 Views
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 Kudos
Reply
4,501 Views
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 Kudos
Reply
4,492 Views
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 Kudos
Reply
4,483 Views
HBH
Contributor II

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

0 Kudos
Reply