No M64 on 28X2?

matherp

Senior Member
Any reason the 28X2 doesn't support 64Meg using the internal oscillator? The 18F25K22 is certainly capable of it in the same way as the 14K22 used for the 20X2. Could this be considered for a new firmware update?

Thanks

Peter
 

nick12ab

Senior Member
Are you sure about that? Page 37 of the datasheet says that:
The PLLEN bit is active only when the HFINTOSC is the primary clock source (FOSC<2:0> = 100X) and
the selected frequency is 8 MHz or 16 MHz (IRCF<2:0> = 11x). Otherwise, the PLLEN bit is unavailable
and always reads ‘0’.
and page 28 of the datasheet shows a diagram of the oscillator block and shows that the primary oscillator is only the external one (see the attachment, which contains the relevant pages only).
 

Attachments

Technical

Technical Support
Staff member
Nick is correct, external and internal cannot both be primary oscillators, so PLL is only available for external (which is the primary) on the 28X2/40X2. 20X2 is different as the internal is primary.
 

matherp

Senior Member
You need to set FOSC in the config to INTIO67 which will boot up at 8MHz and then in software set IRFC in OSCCON to 111 (16MHz) and PLLEN in OSCTUNE to 1 then the chip runs at 64MHz internal. I have a DS30 bootloader running in exactly this way that I use with Swordfish - works great.
 

Technical

Technical Support
Staff member
You appear to have missed the point Nick and we made earlier, we did not say 64MHz internal on the K22 is not possible, it clearly is because the 20X2 already uses that.

However the 28X2 is intentionally designed to optionally use an external resonator as the primary, as many people prefer the accuracy of an external resonator/crystal. Therefore PLL cannot be used on internal oscillation with *the intended 28X2* configuration - primary FOSC external, secondary internal.

In other words we can't always please everyone, at design we had the option of
-up to 64MHz internal but no external oscillator options at all (as used on 20X2)
or
-options of both the external with PLL oscillator (up to 64MHz) and the internal oscillator (without PLL, so max 16MHz internal).

We choose the latter for the 28X2, so if you want 64MHz on a 28X2 simply solder in an external 16MHz resonator.
 
Last edited:

Morganl

Senior Member
Sorry I do not get where the problem is.

Microchip DS41412F
2.8.1
PLL IN EXTERNAL OSCILLATOR
MODES
The PLL can be enabled for any of the external
oscillator modes using the OSC1/OSC2 pins by either
setting the PLLCFG bit (CONFIG1H<4>), or setting the
PLLEN bit (OSCTUNE<6>).
Note the either-or: So PLL for external osc can be enabled or not by the PLLEN bit if PLLCFG is clear.

And in 2.8.2:
The PLLEN control bit of the
OSCTUNE register is used to enable or disable the
PLL operation when the HFINTOSC is used.
So just set PLLCFG (CONFIG1H<4>) clear.
Or what am i missing?
 

hippy

Technical Support
Staff member
Or what am i missing?
Figure 2-1 on page 28.

Note where the PLL is placed and how it can only be assigned to either the Primary Oscillator (external crystal / resonator) or INTOSC. That assignment is set via FOSC<3:0> which is a fuse setting in the CONFIG registers set during production programming.

If you want a PLL on INTOSC then the primary oscillator cannot then be used; no external crystal or resonator would be supported.

If you want to allow an external crystal or resonator then the primary oscillator has to be set using FOSC<3:0> and then there is no path for the INTOSC to go through the PLL.

2.8.1 and 2.8.2 describe when the PLL can be enabled or disabled, not what it is assigned to. Reading those only tells part of the story.
 

Morganl

Senior Member
Wait a minute...
The PIC can rewrite FOSC<3:0> by the same mechanism you probably already use when loading the user program to flash.
Unless you have enabled configuration register protect bit WRTC.
 

hippy

Technical Support
Staff member
Yes, the relevant fuses are set to prevent the firmware being overwritten or chip configuration being changed.
 
Top