.
. PROBLEM:
1. When the chip speed is set to either 32Mhz or 64 Mhz, and FOSC is not configured, the chip does not operate and will not toggle an I/O pin. There is no clock output.
If FOSC is configured for "IRC" the clock frequency is wrong.
With the clock set to either 8 or 16 and Config PLLEN = ON, the Clock frequencies are ok at 32Mhz and 64MHz respectively, but the timings and delays are all inaccurate.
BACKGROUND:
The PIC18F14K22 has an internal 16 Mhz RC oscillator and a 4X PLL. It is capable of providing a system clock of 64Mhz using the internal RC clock source (no crystal).
OBSERVATIONS:
If the MCU clock is set to 32 and Config FOSC = IRC then the ASM shows that the PLL has not been enabled. Reading the frequency at the clock out pin shows 2 MHz, indicating that the clock is at 8 MHZ instead of 32 indicating that the sofware PLLEN Bit is off. With the clock set to 64, the clock out is 250Khz indicating that the IRCF Bits are incorrect as well as the PLLEN bit.
The problem is that the compiler assumes a HS External clock source when the Chip MHZ is set to 32 or 64 and FOSC is not configured. With the Chip set to 32 MHz or 64MHz, and the clock source configured for FOSC = IRC (Internal RC clock), the compiler does not correctly set the software PLLEN bit , or the IRC Bits.
WORKAROUND:
1. Set the chip to either 32 or 64 Mhz
2. Config FOSC = IRC. Do not enable PLL in config
Add the following code to the main Program after the
config settings.
.
IF ChipMHz = 32 then : Set PLLEN ON
IF ChipMHz = 64 then
set IRCF0 ON
set IRCF1 ON
set IRCF2 ON
set PLLEN ON
END IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This issue has been fixed in the latest GCB release and in the latest system.h file. The workaround posted above is not recommended, as the Frequency needs to be correctly set with system.h prior processing other header files such as LCD.H
William
Last edit: William Roth 2015-04-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
.
.
PROBLEM:
1. When the chip speed is set to either 32Mhz or 64 Mhz, and FOSC is not configured, the chip does not operate and will not toggle an I/O pin. There is no clock output.
If FOSC is configured for "IRC" the clock frequency is wrong.
With the clock set to either 8 or 16 and Config PLLEN = ON, the Clock frequencies are ok at 32Mhz and 64MHz respectively, but the timings and delays are all inaccurate.
BACKGROUND:
The PIC18F14K22 has an internal 16 Mhz RC oscillator and a 4X PLL. It is capable of providing a system clock of 64Mhz using the internal RC clock source (no crystal).
OBSERVATIONS:
If the MCU clock is set to 32 and Config FOSC = IRC then the ASM shows that the PLL has not been enabled. Reading the frequency at the clock out pin shows 2 MHz, indicating that the clock is at 8 MHZ instead of 32 indicating that the sofware PLLEN Bit is off. With the clock set to 64, the clock out is 250Khz indicating that the IRCF Bits are incorrect as well as the PLLEN bit.
The problem is that the compiler assumes a HS External clock source when the Chip MHZ is set to 32 or 64 and FOSC is not configured. With the Chip set to 32 MHz or 64MHz, and the clock source configured for FOSC = IRC (Internal RC clock), the compiler does not correctly set the software PLLEN bit , or the IRC Bits.
WORKAROUND:
1. Set the chip to either 32 or 64 Mhz
2. Config FOSC = IRC. Do not enable PLL in config
config settings.
.
This issue has been fixed in the latest GCB release and in the latest system.h file. The workaround posted above is not recommended, as the Frequency needs to be correctly set with system.h prior processing other header files such as LCD.H
William
Last edit: William Roth 2015-04-08