|
|
View previous topic :: View next topic |
Author |
Message |
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
18F25K50 Oscillator Issue.... |
Posted: Mon Jan 19, 2015 7:59 pm |
|
|
Hi All,
I'm in the process of updating an older, working design from the 18F2550 to the 18F25K50, as I want to operate the the MCU at a Vdd of 3.3V, running
at 48MHz. Unfortunately, I can't seem to make a basic test program work correctly, as it does not appear that the crystal oscillator is starting.
My test code runs, but does not blink an LED at the correct rate:
Code: |
for ( iIndex = 0 ; iIndex < 3 ; iIndex++ )
{
output_high(PWR_LED);
delay_ms(250);
output_low(PWR_LED);
delay_ms(250);
}
|
The On/Off times of the LED are about 11 seconds, so it appears that the clock is actually about 1MHz. If I add the NOFCMEN fuse, the LED does not
blink at all. Clearly, the crystal oscillator is not starting, and the internal fail safe oscillator is running instead.....
I've tried my original fuses:
Code: |
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
|
and, also fuses that don't use the PLL:
Code: |
#fuses HS,NOWDT,NOPROTECT,NOLVP,NODEBUG
#use delay(clock=20000000)
|
My compiler version, v4.121, doesn't actually seem to support the 'K' version of this chip (there is no .H file in the devices directory), but it does
compile and load into the chip with CCSLOAD and my ICD-U64.
I'm using the same type 20MHz crystal that works with this board design at 5V, and a pair of 15pf load capacitors on the crystal.
So, any ideas about why the crystal oscillator is not starting? Is my compiler version missing something for this chip, or is there something
else I need to do to ensure the oscillator starts with a Vdd of 3.3V?
Jack |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 19, 2015 8:22 pm |
|
|
The oscillator is not the same between those two PICs. The K50 doesn't
have the PLL pre-scaler. The Config bits are not the same for the oscillator.
You could manually set the fuses, if that feature works in your version.
Example from the CCS manual:
Quote: | To manually set the fuses in the output files use:
#FUSES 1 = 0xC200 // sets config word 1 to 0xC200 |
|
|
|
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
|
Posted: Thu Jan 22, 2015 3:01 pm |
|
|
Hi PCM,
Ugh!
I should have read the datasheets more carefully! Problem is now solved with a compiler upgrade, and new #fuses!
Thanks,
Jack |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|