The Compare Mode 0 is invoked by setting bit “t2cm”=0 of “t2con” register (2.4.18 ).
In mode 0, when the value in Timer 2 equals the value of the compare register, the
comparator output changes from low to high. lt goes back low on timer 2 overflow.
In this mode writing to port 1 (“p1”) will have no effect, because the input line from the internal bus and the write-to-register line are disconnected. Figure below illustrates the function of compare mode 0