S32K148 RTD200 MCAL PWM overflow interrupt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K148 RTD200 MCAL PWM overflow interrupt

ソリューションへジャンプ
394件の閲覧回数
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 解決策
323件の閲覧回数
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 返答(返信)
348件の閲覧回数
Chris_Tigger
Contributor III

The settings interface is shown in the figure below.

Chris_Tigger_0-1751895984019.png

 

Best Regards!
Chris Tigger
0 件の賞賛
返信
324件の閲覧回数
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 件の賞賛
返信