raskolnikov 0 Posted July 14, 2009 Report Share Posted July 14, 2009 Forum, 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 DATA _CONFIG2H, _WDT_OFF_2H #pragma DATA _CONFIG3H, _MCLRE_OFF_3H #pragma DATA _CONFIG2L, _BOREN_OFF_2L & _PWRT_OFF_2L #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. Best, Matt Quote Link to post Share on other sites
Reynard 0 Posted July 14, 2009 Report Share Posted July 14, 2009 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. Cheers Reynard Quote Link to post Share on other sites
Recommended Posts
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.