Hi i need to detect rising edges of a signal but for moments the register counter CNT (eMIOS_1.UC[UCHANNEL_17].CNT.B.CNT) that count to the register A (eMIOS_1.UC[UCHANNEL_17].A.B.A) for moments skips 1 number in the count form 0 to the value wrote in A.
The mode used is "Pulse/Edge Accumulation (continuous)".
I verified this disabling interrupts and only verifying in the main() that the register CNT counts by 1.
For example i have CNT = 0 - 1 - 2 - 3 - ??? - 5.
How is possible?
My code configure:
eMIOS_1.MCR.B.GTBE = OFF;
eMIOS_1.MCR.B.MDIS = 0;
eMIOS_1.MCR.B.FRZ = OFF;
eMIOS_1.MCR.B.ETB = 0;
eMIOS_1.MCR.B.SRV = 0; //Id de servidor
-Mode "Pulse/Edge Accumulation (continuous)" [MODE=8]
-Bus Counter A [BSL=0]
-1 Edge [EDSEL=0]
-Rising Edge [EDPOL=1]
-Prescaler Divide for 1 [UCPRE=0]
eMIOS_1.MCR.B.GTBE = ON;
I adjunt a 2 simple project verifying that:
Prueba_MPC5746R: It conmute pin PD1 for each 10 counts of PEA.
Prueba2_MPC5746R: Its the same but disable interrupts and verifying that counts bad for each increment of NErrorsI and the two numbers "CNTAuxI2" and "CNTAntAuxI2" are the bad count.