Hello All,
I saw PRD_getticks() misbehaves in our system, and would like to see if anyone may have some insights.
In our system, we connect external frame clock (28 Hz) to GPIO/INT4. And we have an HWI to handle that interrupt. All the HWI does right now is to call PRD_getticks() to measure the time stamp, and calculate delta between the INT4, and I store all of it in a circular buffer. I also store out the hardware counter CNT2 and do a delta on CNT2.
Here and there, I saw glitches (item [81]) between adjacent interrupts. When the glitches happened, the hardware counter CNT2 also went to crazy. I also hooked up the INT4 signal to a scope and triggered on pulse smaller than 20 ms, and I was never able to catch one.
In our setup, we have 1GHZ, C6416T, with the counters/PRD registers configured as below:
CTL0 = 00000281
PRD0 = 0001E848
PRD2 = FD51DA80
CTL2 = 00000280
Could anyone please shine some lights to the behavior of PRD_getTicks() and CNT2? We need a reliable PRD_getticks()/CNT2 at least to filter out unwanted HWI.
In here, Ts is PRD_getTicks(), delta is the difference between two adjacent PRD_getticks(), HW is the difference of CNT2 when HWI is dispatched.
[80] 0x81FED900 "FS_ISR = 000080, Ts=00002837 delta=0035, HW=0035, CNT2=152496be CTL=00000281" int8 * hex
[81] 0x81FED950 "FS_ISR = 000081, Ts=00002840 delta=0003, HW=0395, CNT2=181796b8 CTL=00000281" int8 * hex
[82] 0x81FED9A0 "**** Framesync Glitch: tick=2840 prevTick=2837 " int8 * hex
[83] 0x81FED9F0 "FS_ISR = 000081, Ts=00002869 delta=0032, HW=0424, CNT2=184dda44 CTL=00000281" int8 * hex
[84] 0x81FEDA40 "FS_ISR = 000082, Ts=00002904 delta=0035, HW=0035, CNT2=18914a97 CTL=00000281" int8 * hex
Thanks,
Nguyen