Quote Originally Posted by amenoera View Post
thanks for reply , but when i paste this code i get an error .
and am sure i setup it to correct frequency .
Skimask has given you the answer for the error but the frequency will need to be defined as 48MHz when you correct to FCMEN instead of FCMEM. This is because the config settings I have given you set the PIC to run from 48MHz PLL clock source which is generated by the PIC internally but using your 20MHz crystal as the original clock source.

Hope this helps. Let us know how you get on.

Cheers

Rob