S32K148 RTD200 MCAL PWM overflow interrupt

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

S32K148 RTD200 MCAL PWM overflow interrupt

Jump to solution
403 Views
Chris_Tigger
Contributor III

Hi,
1)How to use the overflow interrupt function of the PWM module in the MCAL library? In S32DS, there isn't a callback function setting like in the IP layer. How should I use this function?

2)There is also a question. When using interrupts, the names of the interrupt functions in the platform module must be the same as those in the MCAL. Are these fixed function names and cannot be customized?

Best Regards!
Chris Tigger
0 Kudos
Reply
1 Solution
332 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Chris_Tigger 

To enable the Time Overflow Interrupt, please follow these steps using the Peripheral Tool in ConfigTools:

Configure the Interrupt in the Platform Driver (Interrupt Controller → PlatformIsrConfig):

  • Add and enable the overflow interrupt. For example, for FTM4, use: FTM4_Ovf_Reload_IRQn
  • Assign the Corresponding Interrupt Handler. Continuing with the FTM4 example, assign: FTM_4_OVF_RELOAD_ISR

Set the Notification Function in the PWM Driver (PWMChannelConfigSet → PwmChannel):

  • Assign the desired notification function.

In Code:

  • Initialize the Platform Driver: Platform_Init().
  • Enable PWM Signal Edge Notification: Pwm_EnableNotification(). Ensure the conditions shown in the image below are satisfied

VaneB_0-1752084218809.png

  • Implement the Notification Function. This function will be called periodically by the configured PWM channel.

Regarding your second question. Yes, the interrupt names are predefined and cannot be customized. You can find all the relevant definitions in the S32K148_COMMON.h file. Additionally, for the interrupt handlers, most of them are already defined. For example, in the case of FTM in PWM mode, the handlers are located in the Ftm_Pwm_Ip_Irq.h file.

 

BR, VaneB

View solution in original post

0 Kudos
Reply
2 Replies
357 Views
Chris_Tigger
Contributor III

The settings interface is shown in the figure below.

Chris_Tigger_0-1751895984019.png

 

Best Regards!
Chris Tigger
0 Kudos
Reply
333 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Chris_Tigger 

To enable the Time Overflow Interrupt, please follow these steps using the Peripheral Tool in ConfigTools:

Configure the Interrupt in the Platform Driver (Interrupt Controller → PlatformIsrConfig):

  • Add and enable the overflow interrupt. For example, for FTM4, use: FTM4_Ovf_Reload_IRQn
  • Assign the Corresponding Interrupt Handler. Continuing with the FTM4 example, assign: FTM_4_OVF_RELOAD_ISR

Set the Notification Function in the PWM Driver (PWMChannelConfigSet → PwmChannel):

  • Assign the desired notification function.

In Code:

  • Initialize the Platform Driver: Platform_Init().
  • Enable PWM Signal Edge Notification: Pwm_EnableNotification(). Ensure the conditions shown in the image below are satisfied

VaneB_0-1752084218809.png

  • Implement the Notification Function. This function will be called periodically by the configured PWM channel.

Regarding your second question. Yes, the interrupt names are predefined and cannot be customized. You can find all the relevant definitions in the S32K148_COMMON.h file. Additionally, for the interrupt handlers, most of them are already defined. For example, in the case of FTM in PWM mode, the handlers are located in the Ftm_Pwm_Ip_Irq.h file.

 

BR, VaneB

0 Kudos
Reply