Just looked at the Data Sheet, and best I can tell, it only offers one speed; 4 MHz.
Just looked at the Data Sheet, and best I can tell, it only offers one speed; 4 MHz.
The internal oscillator is set at 4MHz. But if you want 20MHz, then you need to sacrifice two pins, GPIO4 and GPIO5 to be used as Crystal connections for the High Speed oscillator.
Or you can drive the GPIO5 pin with an external can oscillator. See page 53 of the datasheet.
The settings for all above is in the CONFIG word during programming of the chip (page 52 of the datasheet).
Ioannis
Hi ioannis.
Ok, well seen.
The internal oscillator being 4MHz and if we want to work with a definition at 20mHz, an external quartz is then necessary.
This one connecting to GPIO4 and GPIO5 ... which are indeed well provided for this use!
Which had actually escaped me.(
I will review my program by considering this precious information.
Thank you again and have a good week everyone!
So, I then have a few questions left about this command define OSC:
1_The "DEFINE OSC 20" command would only make sense if you really use a 20mHz quartz?
2_With a 20mHz quartz, is the simple fact of configuring the fuse "OSC HS" sufficient? Or will we also have to add the DEFINE OSC 20 command in the program?
3_ The fact that the manual specifies that the DEFINE command can be used to change the predefined value of the oscillator makes you think that it is not necessary to use a quartz to actually work at 20mHz ...
4_ Without Quartz What would the impact of the DEFINE OSC 20 order? The timing unit for Pulsin, Pulsout and Pause commands would still be modified?
Thanks
The ONLY thing the DEFINE OSC command does is inform the compiler what clock speed you're running at so it can adjust various internal timings.
It's completely up to you to set the CONFIG and any runtime settings (OSCCON, etc) that may be required to get you that speed.
there is a manual that answers just about every question available here
eg
4_ Without Quartz What would the impact of the DEFINE OSC 20 order? The timing unit for Pulsin, Pulsout and Pause commands would still be modified?![]()
Warning I'm not a teacher
Bookmarks