Arduino Mega 2560 PE3 pin problem [solved]

I defined PE3 (digital pin 5) as OUTPUT. I want to control it (changing its value from HIGH to LOW several times during execution) but realized it changes its state unexpectedly.

Does anyone know if it is used by any of the standard libraries? Thats the only explanation I have to this issue...

Looks like it is OC3A also (output of Timer 3). Are you using that?

No, I am not using the timer but figured out the problem.

This pin is used as a debug pin in a library I am using. I undefined it and now it works properly.

Many thanks!