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