IPM mode in MPC5777c

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

IPM mode in MPC5777c

Jump to solution
1,059 Views
dineshmoka
Contributor III

Hi, i am using MPC5777c EVB with MPC57xx mother board. i am trying to measure input period of the input signal from multiple input channels simultaneously. I am using a peripheral clock at 132MHz. The following below is my code

void D_EMIOS_0_IPM_Init(uint8_t ui8_channel_no,uint16_t ui16_GPIO_pin_no)
{


SIU.PCR[ui16_GPIO_pin_no].R = 0x0500;
eMIOS_0.MCR.B.GPRE = 0x83;
eMIOS_0_UC.UC[ui8_channel_no].C.B.EDPOL = 1;
eMIOS_0_UC.UC[ui8_channel_no].C.B.MODE = 0x1;
eMIOS_0_UC.UC[ui8_channel_no].C.B.BSL = 0x3;
eMIOS_0_UC.UC[ui8_channel_no].A.R = 0;
eMIOS_0_UC.UC[ui8_channel_no].B.R = 0;

eMIOS_0.MCR.B.GPREN = 0;
eMIOS_0.MCR.B.FRZ = 1;

eMIOS_0_UC.UC[ui8_channel_no].C.B.UCPREN = 0;
eMIOS_0_UC.UC[ui8_channel_no].CNT.R = 0x0;
eMIOS_0_UC.UC[ui8_channel_no].C.B.BSL = 0x3;
eMIOS_0_UC.UC[ui8_channel_no].C.B.ODIS = 1;
eMIOS_0_UC.UC[ui8_channel_no].C.B.MODE = 0x5;
eMIOS_0_UC.UC[ui8_channel_no].C.B.UCPRE = 0;
eMIOS_0_UC.UC[ui8_channel_no].C.B.EDPOL = 1;
eMIOS_0_UC.UC[ui8_channel_no].C.B.EDSEL = 1;
eMIOS_0_UC.UC[ui8_channel_no].C.B.UCPREN = 1;

eMIOS_0.MCR.B.GPREN = 1;
eMIOS_0.MCR.B.GTBE = 1;

IGF_0.MCR19.B.FGEN = 0;
IGF_0.MCR19.B.MDIS = 0;
IGF_0.MCR19.B.RFM = 0;
IGF_0.MCR19.B.FFM = 0;
IGF_0.MCR19.B.FGEN = 1;

}

For single channel i am able to measure the input period correctly. when i am trying to measure from multiple input channels i am not getting desired output, for each input EMIOS channel i modified accordingly IGF_0 MCR register. Let me know any corrections required in my code

   

0 Kudos
1 Solution
1,007 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

no you cannot as there is no connection to MCU pad.

BR, Petr

View solution in original post

0 Kudos
3 Replies
1,032 Views
dineshmoka
Contributor III

Thanks petrs it is working properly.

I Just need some clarification on EMIOS 4 and EMIOS 5 channels. As its mentioned in RM of MPC5777c,  EMIOS 4 and 5 channels are connected to DSPI_B module, can i use EMIOS 4 and 5 channels for input period measurement? In other way how to use EMIOS 4 and 5 channels for input period measurement? 

0 Kudos
1,008 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

no you cannot as there is no connection to MCU pad.

BR, Petr

0 Kudos
1,047 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

eMIOS channel init looks correct. I think you can omit global eMIOS.MCR setting in each function call, this could be done one time, in separate function for example.
Finally you set IGF19 only, so if correct IGF channel is set for given eMIOS channel then it should work normally, I think. See Table 39-2. "IGF_0 channel mapping" of the RM for assignment.

BR, Petr

0 Kudos