S32K148 RTD200 MCAL PWM overflow interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K148 RTD200 MCAL PWM overflow interrupt

跳至解决方案
381 次查看
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 项奖励
回复
1 解答
310 次查看
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 项奖励
回复
2 回复数
335 次查看
Chris_Tigger
Contributor III

The settings interface is shown in the figure below.

Chris_Tigger_0-1751895984019.png

 

Best Regards!
Chris Tigger
0 项奖励
回复
311 次查看
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 项奖励
回复