Measure eTPU pulse duration on eMIOS channel.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Measure eTPU pulse duration on eMIOS channel.

1,223 Views
snehakalkhair
Contributor III

Hi,

I am using MPC5674F Power PC.

My goal is to measure the pulse period of the PWM signal coming from eTPU on eMIOS.

Can I implement the same using the IPM mode?

What will be the setting of FMPLL for eMIOS since the eTPU refers the TCR clock?

Please help.

 

Regards,

Sneha.

Labels (1)
Tags (2)
0 Kudos
5 Replies

911 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

yes, IPM can be used. Attached you will find very simple example. It was written for old MPC5567 but the principle is still the same.

There's only one PLL which generates clocks for whole device. Attached you will find excel configurator.

Regards,

Lukas

0 Kudos

911 Views
snehakalkhair
Contributor III

Thanks a lot for the sample program.

But i don't understand , for some reason my while loop is not executing further since my CSR FLAG for channel 0 is not being set. while(!EMIOS.CH[0].CSR.B.FLAG)

and if i try to set it with EMIOS.CH[0].CSR.B.FLAG = 1;

the overflow bit is set to 1.

please help me how to handle overflow and also the reason why the execution is stuck on the while loop.

Regards,

Sneha.

0 Kudos

911 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I just copied the code from main.c to project created for MPC5674F - see attachment.

I externally connected EMIOS0 to EMIOS1. If you use this EVB board:

MPC567XKIT416-PT, MPC567XKIT516-PT|NXP

... just short pin 1 and pin 2 on header J25 which can be found on motherboard.

EMIOS1 generates PWM signal, EMIOS0 measures the pulse length using IPM function.

It works as expected:

pastedImage_0.png

Lukas

0 Kudos

911 Views
snehakalkhair
Contributor III

Hi,

Thanks a lot for the sample code and explanation. It worked.

I would like to know, what is the maximum limit of  PWM signals we can measure at the same time?

eg. If i have input 10 PWM input signals at the same time to get the pulse width , can i measure it? If yes, then at the same instant maximum how many PWM signals i can input to measure the widths if they have different duty cycles and frequencies.

Please help.

0 Kudos

911 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

this is application dependent. EMIOS channel itself works independently, so it is able to capture the edges anytime - the only thing you have to consider is that minimum pulse width is 4 cycles.

pastedImage_0.png

The rest is a matter of software - how many interrupts will be there, what you want to do with captured numbers, what are the max frequencies of measured signals, it depends if all measured signals can run at max frequency at the same time... So, there are a lot of variables you have to consider...

Lukas

0 Kudos