AnsweredAssumed Answered

MPC5645S eMIOS_SAIC problem

Question asked by duoba duo on Sep 18, 2016
Latest reply on Sep 19, 2016 by duoba duo

Hi,

I am using the MPC5645S. I use the channel 20 and channel 21 of  the eMIOS1 with SAIC  mode. Two channels register configuration  and initialize  are the same. but the channel 21 can capture the input  frequency signal and enter the interrupt .The channel 20 can't enter the interrupt. 

who can help me to solve this problem.   

Thanks!

 

void EMIOS1Init(void)
{
EMIOS_1.MCR.B.GPRE = 255; // 64M/256=250kHz
EMIOS_1.MCR.B.GPREN = 1; 
EMIOS_1.MCR.B.FRZ = 1; 
}// end of EMIOS1Init

 

void CounterBusAInit(void)
{
EMIOS_1.CH[23].CADR.R = 0xFFFF;
EMIOS_1.CH[23].CCR.B.MODE = 0x50; 
EMIOS_1.CH[23].CCR.B.BSL = 0x3; 
EMIOS_1.CH[23].CCR.B.UCPRE = 0x1; // 250k/2 =125kHz
EMIOS_1.CH[23].CCR.B.UCPEN = 1;
EMIOS_1.CH[23].CCR.B.FREN = 1;
EMIOS_1.CH[23].CCR.B.FEN = 1;
}// end of CounterBusAInit

 

void ICInit(void)
{
UBYTE i;
SIU.PCR[PF1].R = 0x0500; // EMIOS1-20
SIU.PCR[PF3].R = 0x0500; // EMIOS1-21
EMIOS1Init(); 
for( i=20;i<22;i++ )
{
EMIOS_1.CH[i].CCR.B.MODE = 0x02; // SAIC mode
EMIOS_1.CH[i].CCR.B.BSL = 0x00; 
EMIOS_1.CH[i].CCR.B.IF = 0x02;
EMIOS_1.CH[i].CCR.B.FCK = 1;
EMIOS_1.CH[i].CCR.B.FEN = 1;
EMIOS_1.CH[i].CCR.B.DMA = 0; 
EMIOS_1.CH[i].CCR.B.EDSEL = 0; 
EMIOS_1.CH[i].CCR.B.EDPOL = 1; 
EMIOS_1.CH[i].CCR.B.UCPRE = 0; 
EMIOS_1.CH[i].CCR.B.UCPEN = 1; 
EMIOS_1.CH[i].CCR.B.FREN = 1; 
}
CounterBusAInit(); 
INTC_InstallINTCInterruptHandler(ISR_SAIC20,169,3);
INTC_InstallINTCInterruptHandler(ISR_SAIC21,170,3);
INTC_InstallINTCInterruptHandler(ISR_EMIOS123OVFL,172,3);
}// end of ICInit

Outcomes