Do we need to clear IC2Buff value upon IC2 interrupt though the values are directly fetched from 32 bit timer.
I don't understand what you want to clear. The whole point is that you do NOT clear the timers, just calculate how far they have advanced since the previous interrupt.
Hi Ric, Input Capture Overflow (ICOV):
(Quick reference from datasheet)
The ICOV read only Status bit (ICxCON<4>) will be set when the capture buffer overflows. In the
event that buffer is full with four capture events
and a fifth capture event
occurs prior to a read of
the buffer, an overrun condition will occur, the ICOV (ICxCON<4>) bit will be set to a logic ‘1’ and
the respective capture event interrupt will not be generated
. In addition, the fifth capture event is
not recorded and all subsequent capture events will not alter the current buffer contents.
To clear the overrun condition, the capture buffer must be read four times. Upon the fourth read,
the ICOV (ICxCON<4>) status flag will be cleared and the capture channel will resume normal
Though there is no effect of reading or avoiding ICxBUF values for now, I am capturing ICxBUF value to an dummy variable to avoid malfunction.