Jump to content

Crystal Oscillator Setup

Recommended Posts



I can't seem to get a 20MHz crystal oscillator to work with my PIC18F4685. I have to believe that it is a configuration issue. This is the current configuration:


#pragma DATA _CONFIG1H, _OSC_HS_1H




#pragma CLOCK_FREQ 20000000


When I program the u-controller and power it up it will work with or without the crystal hooked to it which tells me that it is defaulting to some internal oscillator. Perhaps there is some setting I am missing.





Link to post
Share on other sites

Hi Matt,


If you don't specify config bits, SourceBoost tends to set them to '1'. Although you have only specified _OSC_HS_1H in CONFIG1H, you also have FCMEN bit set which enables the failsafe oscillator to kick in should the HS oscillator fail which is possibly what you are seeing.


Also make sure the extended instruction set is NOT enabled if you change CONFIG4L.





Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...