S32K344 eMios Signal Measurement Problem

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

S32K344 eMios Signal Measurement Problem

ソリューションへジャンプ
2,275件の閲覧回数
tsirkunenkoa
Contributor II

Hi,

we need to use the Period and Duty Cycle measurement functionality of the eMios module. However, when trying to apply PWM to the corresponding port - the results of corresponding measurement functions are zeros. Is it possible to verify if the eMios ICU works in this mode?

Setup:
S32K3X4EVB-Q172 board. The eMios PWM example was taken as a base one, ICU module was added on top with corresponding functions:

tsirkunenkoa_0-1652438746317.png


The corresponding additional pin for measurement was setup:

tsirkunenkoa_1-1652438825635.png

A jumper wire with no resistance was connected between the pins in the following way (shown with red line):

tsirkunenkoa_2-1652438989993.png

ICU module configuration:

tsirkunenkoa_3-1652439088302.png

 

tsirkunenkoa_4-1652439103038.png

RTD version:

tsirkunenkoa_5-1652439236354.png


I can attach the project archive upon request.

Thank you in advance!

0 件の賞賛
返信
1 解決策
2,269件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @tsirkunenkoa,

You can refer to this example:

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K344-Example-Emios-Icu-IPWM-measurement-DS34-RTD...

It uses customized ISR, but the configuration of the drivers should be very similar to your usecase.

 

Regards,

Daniel

 

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
2,270件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @tsirkunenkoa,

You can refer to this example:

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K344-Example-Emios-Icu-IPWM-measurement-DS34-RTD...

It uses customized ISR, but the configuration of the drivers should be very similar to your usecase.

 

Regards,

Daniel

 

0 件の賞賛
返信
2,261件の閲覧回数
tsirkunenkoa
Contributor II

Hello @danielmartynek,

Thank you for your quick reply!

I have tried your example and everything is working! I suppose that these measurement functions should only be called from the interrupt then, right? If so, it would be nice if this was mentioned in the function comments.

Also, I would normally just give the "Interrupt Control" driver the corresponding "EMIOS1_5_IRQ" function handler, however it seems like the only solution currently is to do it the way you said (by creating interrupt handler ourselves) since there is no callback function that can be setup for Singal Measurement mode.

Have a nice day!

0 件の賞賛
返信
2,252件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

You can leave the ISR to the driver.

But as you said, there is no notification, and it would have to be polled.

 

BR, Daniel

 

0 件の賞賛
返信
2,098件の閲覧回数
ywjack
Contributor III

Hello NXP Technical Support: I want a DEMO about the EB MCAL configuration ICU module is configured to input capture PWM duty cycle, because I found that the ICU I configured cannot trigger interrupts, I am using a S32K146 microcontroller, EB tresos version is 27.1.0. So I want a demo to compare and see.

0 件の賞賛
返信
2,249件の閲覧回数
tsirkunenkoa
Contributor II

Ok, I see that it shouldn't be necessarily called from an interrupt, but can be checked in a for loop until the period is not zero.

Regarding the notification, it would be great if this functionality could be added. Otherwise, if the asynchornous measurement is required - the developers would need to write their custom ISR handler. The main problem here is that this ISR handler is used by other channels as well if they are configured (e.g. EMIOS1_5_IRQ will handle 0, 1, 2, 3 channels) and in this case we would need to differentiate from which channel the interrupt came from and act accrodingly, e.g. the following way:

if ( 0U != ((Emios_Ip_paxBase[1]->CH.UC[0].S) & (uint32)eMIOS_S_FLAG_MASK)

 But anyway, I hope the notifications for measurements or channels will be added soon.

Thanks again and I will continue as is.

0 件の賞賛
返信
2,239件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

You are right.

Let me create a ticket to the RTD team.

 

Regards,

Daniel