Hi NXP team,
We are using S32K344 EVK board and s32 design studio 3.5 .
We need to generate a PWM signal and generate the interrupts on both leading and falling edges of the pulse.
Is there any sample code in the SDK to do this one?
Although we are able to generate the PWM signal, but we are unable to generate the interrupt.
Please assist me in fixing this problem.
Best regards,
Hareesh
已解决! 转到解答。
Please ask a new question if you have any questions that are not related to the original topic of an existing case. It helps to keep it clear. Thank you for your understanding.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi @Robin_Shen ,
Thanks for the update.
After adding that function, the PWM ISR is working properly.
However, how can we distinguish between leading-edge and trailing-edge events in the ISR?
Is there any event checking for both edges of the pulse?
Best regards,
Hareesh
Hi @Robin_Shen ,
For the OPWFMB mode (variable frequency and variable duty cycle), we require a PWM frequency of 0.5 Hz.
The system clock and ADC clock will both decrease if the EMIOS module frequency is lowered to achieve lower frequency PWM because both have the same source clock (CORE_CLK) (Please refer the attached screenshot).
Is it feasible to switch the EMIOS module's clock source from CORE_CLK? If so, how should it be done?
If we set the CORE_CLK = 20 MHz,
EMIOS_CLK = 20M / 16(Clock Prescaler) = 1.25 MHz
Period [in ticks] = EMIOS_CLK / PWM in Hz
PWM in Hz = EMIOS_CLK / Period [in ticks]
PWM in Hz = 1.25 MHz / 65535 (The maximum value we can set in S32 DS IDE)
PWM in Hz = 19.07 HZ
Thus, we will only obtain a minimum PWM frequency of 19.07 Hz when we use the maximum clock prescaler and period value combinations.
In order to get a PWM frequency of 0.5 Hz in OPWFMB mode, what setups are required?
Best regards,
Hareesh