Device = 18F24k22 'using Vdd = 3.3 or 5.0 volts
Clock = 64 'using 16 MHz x4 = 64
Config FOSC = HSHP
Config PLLCFG = ON
The lines above compile just fine
Changing the processor from 18F24K22 TO 18F14K22
CAUSES ERRORS ON THE Config FOSC - HSHP line
Device = 18F14k22 'using Vdd = 3.3 or 5.0 volts
Clock = 64 'using 16 MHz x4 = 64
Config FOSC = HSHP
Config PLLCFG = ON
Message=Compilation errors
Image=3
[COMPILE_ERROR]
ITEM_0="C:\Users\User\Documents\Swordfish\18F14k22 NEW.bas","22","15","Invalid option : HSHP"
ITEM_1="C:\Users\User\Documents\Swordfish\18F14k22 NEW.bas","23","8","Identifier not declared : PLLCFG"
clock settings for 18F24k22 do not work for 18F14k22 ?
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: clock settings for 18F24k22 do not work for 18F14k22 ?
Each device has it's own set of CONFIG settings, and many times they're different.
The choices are spelled out in the datasheet, usually in a chapter titled "Special Features of the CPU".
They're also called out at the end of the device .bas file in the 'Includes' folder (ie "18F14K22.bas")
The easy way is to use the ConfigGenerator plugin to see the different options.
It'll generate the code for you, which you can paste into your file.
I think the equivalent settings for a 14K22 would be:
Watch out using the 14K22... that chip has some nasty peripheral errata that they've never seen fit to fix.
The choices are spelled out in the datasheet, usually in a chapter titled "Special Features of the CPU".
They're also called out at the end of the device .bas file in the 'Includes' folder (ie "18F14K22.bas")
The easy way is to use the ConfigGenerator plugin to see the different options.
It'll generate the code for you, which you can paste into your file.
I think the equivalent settings for a 14K22 would be:
Code: Select all
device = 18F14K22
config
FOSC = HS, // HS oscillator
PLLEN = ON // Oscillator multiplied by 4
Re: clock settings for 18F24k22 do not work for 18F14k22 ?
Hi Jerry
Thanks very much. I should know better than to assume with Microchip. It seemed logical that the same family of devices would have similar configs and what works for the 44k22 and 24k22 would work for the 14k22. I shall use the config steadfastly from here on. Thanks also for the tip on errata.
I wouldn't go near a pic device without the compiler but it is nice that they still produce the dual in line packages...
Thanks again
Lee
Thanks very much. I should know better than to assume with Microchip. It seemed logical that the same family of devices would have similar configs and what works for the 44k22 and 24k22 would work for the 14k22. I shall use the config steadfastly from here on. Thanks also for the tip on errata.
I wouldn't go near a pic device without the compiler but it is nice that they still produce the dual in line packages...
Thanks again
Lee
Re: clock settings for 18F24k22 do not work for 18F14k22 ?
Hello
Here is the link to the 18F14k22 Silicon Errata and Data Sheet Clarification which I believe Jerry was referencing...
https://ww1.microchip.com/downloads/aem ... 00437H.pdf
Here is the link to the 18F14k22 Silicon Errata and Data Sheet Clarification which I believe Jerry was referencing...
https://ww1.microchip.com/downloads/aem ... 00437H.pdf
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: clock settings for 18F24k22 do not work for 18F14k22 ?
Yeah, you would think a "K22 is a K22", but sadly that's not the case... there are at least three different datasheets for the "K22 family".
One thing I've learned is to never assume ANYTHING with Microchip!
One thing I've learned is to never assume ANYTHING with Microchip!
Re: clock settings for 18F24k22 do not work for 18F14k22 ?
Hi Jerry,
Or as I just discovered, I could have used your include file: Include "intosc.bas". it works the same for the 24k22 or 14k22 and I don't have to solider a resonator and 1meg resistor. I really need to do more snooping on the home page as well as here...
Thanks again
Lee
Or as I just discovered, I could have used your include file: Include "intosc.bas". it works the same for the 24k22 or 14k22 and I don't have to solider a resonator and 1meg resistor. I really need to do more snooping on the home page as well as here...
Thanks again
Lee