Quote Originally Posted by scalerobotics View Post
Did you set the OSCCON register? Otherwise it will default to 1 mhz (x4 pll) = 4 mhz.
I didn't do that setting before. I did it now and everything works fine now.

Thank you so much for your help.