Hi, NXP: I am trying to generate the PWM using Emios pwm mode with S32K312. Is there any method could only generate one period and stop generated the pwm?
For single pulse with eMIOS there are two ways, using DAOC or OPWMB mode.
Please find attached projects.
In DAOC mode, pulse width will be defined by duty cycle and it will enter to the ISR once.
In OPWMB mode, it will be necessary an extra GPIO output, pulse width will be defined by period and it will enter to the ISR twice.
If you need continuous pulses, comment "#define Single_Pulse" line.
Please use S32DS 3.6 and RTD 5.0.0 with S32K31XEVB-Q100. If you need an different S32K3 derivative, you can create a new project, do manual config and code copy.
Hi, @_Leo_ :
Thank you for your previous feedback.
We observed that after calling Emios_Pwm_Ip_InitChannel(), the PWM pulse was successfully generated, and an interrupt event was triggered. However, it seems that the callback function subsequently disabled the interrupt notification.
We would like to understand the correct procedure for generating the PWM pulse again. Specifically:
Is it appropriate to call Emios_Pwm_Ip_InitChannel() again to re-trigger the pulse?
Or is there an alternative API that should be used to restart pulse generation and re-enable the interrupt?
We would appreciate your clarification on the recommended approach for re-generating the pulse after the initial trigger.
Please help us create a new post or ticket for this new request. Feel free to reference this post.
Thank you in advance for your understanding.
We are currently working with the S32K312, and would like to generate a single pulse using the eMIOS module in PWM mode, and then capture the generated pulse using ICU.
According to the eMIOS training material, it appears that DAOC mode (Dual Action Output Compare) can be used to generate a single pulse.
We would like to confirm:
Is DAOC mode supported on the S32K312 platform?
We attempted to configure DAOC mode, but the result was a repetitive (continuous) pulse, instead of a single-shot pulse.
Are there any specific tips or configuration requirements to ensure only one pulse is generated?
Our goal is to:
Generate one-time high-level output (e.g., 5ms pulse width)
Automatically return to low after the pulse
Avoid repeated waveform generation
Any guidance, example, or clarification would be greatly appreciated.
Hi @CCY_Yu
Could you please provide more details about the implementation you are ooking to achieve?
As your goal is to generate a single PWM period and then stop, in my opinion, using a timer would be a good option. This allows you to toggle a pin for a specific duration, representing one full PWM cycle and then automatically stop without further toggling. This approach is more suitable than continuous PWM generation when only a single pulse is needed.
BR, VaneB
Hi, @VaneB :
Any update on this topic?
Hi @CCY_Yu
I was able to reproduce the behavior you described, and I am looking into the situation to better understand what is going on. I will keep you updated as I make progress.