S32K344 MCAL IPWM ICU CAPTURE

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

S32K344 MCAL IPWM ICU CAPTURE

跳至解决方案
1,729 次查看
JAY_SUN1
Contributor II

Hi NXP team,

We would like to develope EMIOS ICU on S32K344 EVM with NXP MCAL. But we didn't find the example code for IPWM. Could you provide to us for reference? Thanks.

Wade

 

0 项奖励
1 解答
1,700 次查看
nxf78987
NXP Employee
NXP Employee

Hi JAY_SUN1,

When you call "Icu_GetDutyCycleValues", there is no value because you are using the "EMIOS1_1_IRQn_customized" (your interrupt function) instead of "EMIOS1_1_IRQ" of the driver.

In the driver, The EMIOS1_1_IRQ function will call to Emios_Icu_Ip_IrqHandler(1, 16); to update values to variables available in the driver, and when you call Icu_GetDutyCycleValues(),  you can get results in this situation.

So that when you use EMIOS1_1_IRQn_customized, to call Icu_GetDutyCycleValues() and get results successfully, you must work as image below:

nxf78987_0-1666751171404.png

Best regards,

Dan

在原帖中查看解决方案

0 项奖励
5 回复数
1,685 次查看
nxf78987
NXP Employee
NXP Employee

Hi JAY_SUN1,

This is an example code for IPWM.

To run this example, you need to connect PTA29 with PTD15(IcuChannel_2).

Best regards,

Dan

0 项奖励
1,708 次查看
JAY_SUN1
Contributor II

Hi NXP team,

We are still wating for your reply!

Attached is my project, it can enter in ISR, but when I call "Icu_GetDutyCycleValues", there is no value. Please help to check it and let us know the solution. Thanks.

Please note that I use Emiso 1 CH12(PTA29) to produce PWM(period 1K / Duty 25%), and use Emiso 1 CH16(PTG0) to receive PWM signal.  

Wade

0 项奖励
1,701 次查看
nxf78987
NXP Employee
NXP Employee

Hi JAY_SUN1,

When you call "Icu_GetDutyCycleValues", there is no value because you are using the "EMIOS1_1_IRQn_customized" (your interrupt function) instead of "EMIOS1_1_IRQ" of the driver.

In the driver, The EMIOS1_1_IRQ function will call to Emios_Icu_Ip_IrqHandler(1, 16); to update values to variables available in the driver, and when you call Icu_GetDutyCycleValues(),  you can get results in this situation.

So that when you use EMIOS1_1_IRQn_customized, to call Icu_GetDutyCycleValues() and get results successfully, you must work as image below:

nxf78987_0-1666751171404.png

Best regards,

Dan

0 项奖励
1,681 次查看
JAY_SUN1
Contributor II

Hi Dan,

Thanks for your reply and it can work now.

Wade

518 次查看
James123
Contributor II
hello in the icu get dutycycle function it is not getting any values do we need partition on icu can you also send some sample code of it working
0 项奖励