CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18F25K50 Oscillator Issue....

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JAM2014



Joined: 24 Apr 2014
Posts: 138

View user's profile Send private message

18F25K50 Oscillator Issue....
PostPosted: Mon Jan 19, 2015 7:59 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 19, 2015 8:22 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 22, 2015 3:01 pm     Reply with quote

Hi PCM,

Ugh!

I should have read the datasheets more carefully! Problem is now solved with a compiler upgrade, and new #fuses!

Thanks,

Jack
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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