PWM interrupt not hitting

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

PWM interrupt not hitting

ソリューションへジャンプ
1,803件の閲覧回数
Hareesh
Contributor I

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

0 件の賞賛
返信
1 解決策
1,587件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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.

元の投稿で解決策を見る

0 件の賞賛
返信
11 返答(返信)
1,751件の閲覧回数
Hareesh
Contributor I

Hi,

Could someone please assist me in resolving this problem?

 

Best regards,

Hareesh

0 件の賞賛
返信
1,740件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport
Hi Hareesh,
I'm sorry for the delay, I have been overloaded the last couple of days.
Please add the following function to the test project you sent me:
Emios_Pwm_Ip_SetFlagRequest(INSTANCE_0, CHANNEL_2, EMIOS_PWM_IP_INTERRUPT_REQUEST);


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 件の賞賛
返信
1,683件の閲覧回数
Akhil1
Contributor I

Hi @Robin_Shen ,

I am also working on PWM interrupt in s32K3, can you please provide the sample code for it

 

Thanks Akhil

0 件の賞賛
返信
1,726件の閲覧回数
Hareesh
Contributor I

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

0 件の賞賛
返信
1,686件の閲覧回数
Akhil1
Contributor I

Hi @Hareesh ,

I am also working on PWM interrupt, can you please send me the sample code

Thanks Akhil

0 件の賞賛
返信
1,614件の閲覧回数
Hareesh
Contributor I

Hi @Akhil1 ,

 

Please find the attached file for example code.

 

Best regards,

Hareesh 

0 件の賞賛
返信
1,392件の閲覧回数
Dev15
Contributor III

@Hareesh ,

The project is not available to download. Please upload the pwm working ISR project.

Thank you

0 件の賞賛
返信
1,576件の閲覧回数
Akhil1
Contributor I

Hi @Hareesh ,

Thank you for your support..It is working fine.

Regards

Akhil

0 件の賞賛
返信
1,722件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Try to read the voltage level of the PWM output pin in the ISR.

0 件の賞賛
返信
1,628件の閲覧回数
Hareesh
Contributor I

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

0 件の賞賛
返信
1,588件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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.

0 件の賞賛
返信