inputcatch IPWM on EMIOS0 MPC5748G

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

inputcatch IPWM on EMIOS0 MPC5748G

Jump to solution
3,136 Views
Ben_500
Contributor II

I'm using DEVKIT-MPC5748G and I want to get 4 PWM signals from CH 10, 11, 12, 13 EMIOS0
thanks to sample code I can get 1 PWM signal from EMIOS from CH 13. 

And for other PWM input,
EMIOS_0_CH10_CH11_IRQhandler , MIOS_0_CH12_CH13_IRQhandler is not entered.
 

and eMIOS_UC_0.UC[t_channel].S.R is not updated. 

for now, I copied and pasted for other IPWM below code.
(Of course, I changed each index and channel number)

t_Index = 4;
t_Channel = 13;
 
eMIOS_UC_0.UC[t_Channel].C.B.EDPOL = vEcaleMIOS_Info[t_Index].Edpol_u8;
eMIOS_UC_0.UC[t_Channel].C.B.EDSEL = vEcaleMIOS_Info[t_Index].Edsel_u8;
eMIOS_UC_0.UC[t_Channel].C.B.FEN = 0;
eMIOS_UC_0.UC[t_Channel].A.R = 0x0000FFFF;
eMIOS_UC_0.UC[t_Channel].C.B.IF = 1;
eMIOS_UC_0.UC[t_Channel].C.B.BSL = 0; 
eMIOS_UC_0.UC[t_Channel].C.B.MODE = vEcaleMIOS_Info[t_Index].Mode_u8;
eMIOS_UC_0.UC[t_Channel].C.B.UCPRE = 0;
eMIOS_UC_0.UC[t_Channel].C.B.UCPREN = 1;
INTC.PSR[MCALEMIOS_0_CH12_CH13_PSR].R = PRC_SEL_CPU0 | PRC_PRI(7);
eMIOS_UC_0.UC[t_Channel].C.B.FEN = 1;
 

Can you help this??

Tags (3)
0 Kudos
Reply
1 Solution
2,959 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I want 4 PWM input capture by eMIOS.
for input capture I set the channel No 10, 11, 12, 13 in module 0 from Pin port PF12, PA0, PG7, PG9

Ok, looking at reference manual on channels 10,11,12,13 can be set input capture on eMIOS0 and eMIOS1:

petervlna_0-1739190733633.png

petervlna_2-1739190759866.png

but CPU get just 1 PWM input despite of using same code.

i have no idea what code you have used.

But simply set the pins for input in SIUL2:

Looking at IO_MUX table I see following ports available:

No 10, 11, 12, 13 in module 0 from Pin port PF12, PA0, PG7, PG9

petervlna_0-1739440214672.png

that could express your issues as only PA0 is mapped to the eMISO from your pins.

Best regards,

Peter

 

 

 

View solution in original post

0 Kudos
Reply
7 Replies
3,081 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

what I want is to get Freq and Duty in BSW from signal box.

Please state clearly your requirements

like : I want 4 PWM signals to be captured by eMIOS, and generated 2 PWM outputs.

on each period I want to rise interrupt / DMA etc....

So I see clearly what you are looking for, then I can guide you/give hints.

Best regards,

Peter

0 Kudos
Reply
3,028 Views
Ben_500
Contributor II

Sorry for unclear requirement.

I want 4 PWM input capture by eMIOS.
for input capture I set the channel No 10, 11, 12, 13 in module 0 from Pin port PF12, PA0, PG7, PG9

but CPU get just 1 PWM input despite of using same code. 

It seems that CPU cannot get imput signal from Pin Port initialization.
I couldnt clarify which part of code is wrong.(Port initialzation? not active Vector table?)

So Please tell me PWM input capture sequence spcifically.

Still unclear to explain,,, Sorry for the inconvenience

0 Kudos
Reply
2,960 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I want 4 PWM input capture by eMIOS.
for input capture I set the channel No 10, 11, 12, 13 in module 0 from Pin port PF12, PA0, PG7, PG9

Ok, looking at reference manual on channels 10,11,12,13 can be set input capture on eMIOS0 and eMIOS1:

petervlna_0-1739190733633.png

petervlna_2-1739190759866.png

but CPU get just 1 PWM input despite of using same code.

i have no idea what code you have used.

But simply set the pins for input in SIUL2:

Looking at IO_MUX table I see following ports available:

No 10, 11, 12, 13 in module 0 from Pin port PF12, PA0, PG7, PG9

petervlna_0-1739440214672.png

that could express your issues as only PA0 is mapped to the eMISO from your pins.

Best regards,

Peter

 

 

 

0 Kudos
Reply
2,909 Views
Ben_500
Contributor II

For now, I think Hw pin configuration would be answer.

Thanks a lot!!

Tags (3)
0 Kudos
Reply
3,113 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

This example show how to create shifted PWM channels. Simply add more channels as you like by following the 2 channels configured in example.

Code can be reused on MPC5748G.

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5746C-eMIOS-Shifted-PWM-GHS716/ta-p/1...

Best regards,

Peter

0 Kudos
Reply
3,106 Views
Ben_500
Contributor II
First of all, Thanks for your support!!
but is it can be applied on IPWM input catch?
I think current source code is made for the modes of EMIOS are OPWM like below
eMIOS_UC_0.UC[0].C.B.MODE = 0x60; // OWPMB mode

what I want is to get Freq and Duty in BSW from signal box.
0 Kudos
Reply
3,092 Views
Ben_500
Contributor II
And I also found that each IRQhandler is not active.
So, I want to know why the IRQhandler is not active inspite each port pin received the PWM input.

I have no idea why eMIOS_UC.UC[channel].S.R is not set as 1
0 Kudos
Reply