Hi stefan: Since morning I was working on this problem and finally I found the solution. your code is fine except GP3 you need to make it input. in Mplab go option then hardware then change the oscillator type to internal no output it will work fine. Mplab still things that you are running external clock. Andre Abelian