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 support@ccsinfo.com

18f2550,crystal=4mhz,usb=48mhz,cpu=4mhz

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



Joined: 23 Jun 2011
Posts: 5
Location: Ecuador

View user's profile Send private message MSN Messenger

18f2550,crystal=4mhz,usb=48mhz,cpu=4mhz
PostPosted: Thu Jun 23, 2011 11:47 pm     Reply with quote

The title exposes my problem, I need to work with these characteristics because of my application...

I test a program with these fuses:
Code:

#include <18F2550.h>
#device adc=8
#fuses PLL1,CPUDIV1,USBDIV,XTPLL,VREGEN,NOWDT,NOPBADEN,NOLVP,NODEBUG,NOPROTECT
#use delay(clock=4000000)

and it didn't work.

I browse in Microchip C a fuse called: "XTPLL_XT", I believe with this fuse my program would work... but this fuse isn't implemented in ccs compiler? :(

Would someone help me please?
Ttelmah



Joined: 11 Mar 2010
Posts: 19333

View user's profile Send private message

PostPosted: Fri Jun 24, 2011 2:30 am     Reply with quote

Change the XTPLL fuse to just XT.

Key to understand is that the PLL is always connected on the x550 chip. XTPLL, says take the _CPU_ clock from the PLL route - with the settings you have, this runs the CPU at 48MHz - Look at the oscillator diagram FIG 2-1 in the data sheet. On this, you see the clock feeding from the crystal directly into the CPUDIV divider, called 'XT, HS, EC, & ECIO'. These correspond to the CCS fuses for this direction, or being fed from the USB PLL, called 'HSPLL, ECPLL, XTPLL, and ECPLL' - you are selecting the latter.

However, unless your USB application is very tightly written, running the CPU at 4MHz, might be a problem, with it being much more likely to give USB faults. If you don't need great accuracy, consider clocking the CPU off the internal RC at 8MHz, or using XTPLL and CPUDIV4 to give 16MHz (remember the CPUDIV numbers are divisions on the 'non PLL' route, and binary pattern 11, gives /4 on the direct route, and /6 from the PLL....).
There is no fuse called XTPLL_XT (for fuses, look at the data sheet), This is a Microchip code for what in the data sheet, is just called 'XT' - CCS use the same nomenclature.

Best Wishes
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