S32k3 PWM Capture Duty Cycle only works in IRQ

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

S32k3 PWM Capture Duty Cycle only works in IRQ

157 Views
noobsplzwin
Contributor I

Hi NXP team,

I'm currently working on a project that involves capturing the PWM duty cycle on PTB3 using EMIOS0_CH9 on an S32K344 MCU. I've configured my project using S32 Configuration Tools (S32CT) and have attached my configuration and a piece of my code below for reference.

The issue I'm facing is that I can only read the duty cycle value in an interrupt request (IRQ). However, when I try to read it in a polling method (inside while(1) loop), I keep getting a duty cycle reading of 0.

Is it a requirement that the ICU for duty cycle must be called in an IRQ, or is there a way to successfully read the duty cycle value using polling?

noobsplzwin_2-1717469057072.png

 

noobsplzwin_3-1717469069573.png

noobsplzwin_4-1717469079014.png

 

noobsplzwin_0-1717468846653.png

 

noobsplzwin_1-1717468939257.png

Hardware - Custom S32k344 board
SDK - S32K3 Real-Time Drivers AUTOSAR R21-11 Version 3.0.0
PWM input frequency - 800 Hz

Thanks for any helps in advance.

 

Regards,

Connor

0 Kudos
Reply
1 Reply

130 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Please check the returned value of Emios_Icu_Ip_GetInputState before call Emios_Icu_Ip_GetDutyCycleValues.

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.
-------------------------------------------------------------------------------

0 Kudos
Reply