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

Problem with oscillator config and USB for 18FL2455

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



Joined: 08 Nov 2007
Posts: 6

View user's profile Send private message

Problem with oscillator config and USB for 18FL2455
PostPosted: Wed Nov 21, 2007 4:21 am     Reply with quote

I´m using a system with 4MHZ crystal input on OSC1 OSC2 and a 32,768kHZ on T1OSC.

Here is my problem. I want to be able to use USB and have my CPU running in 4MHZ.

Here are my FUSES

#FUSES USBDIV
#FUSES XTPLL
#FUSES PLL1
#Fuses CPUDIV4

with these settings the USB works fine, but my cpu is the running at 24MHZ

Can anyone please help me how to be able to use the USB with the cpu running at 4MHZ
Ttelmah
Guest







PostPosted: Wed Nov 21, 2007 5:09 am     Reply with quote

You need to use:
XT, PLL1, USBDIV, CPUDIV0

This tells the _CPU_, not to use the USB PLL output, but instead to use the master clock, and to not divide this (so it runs at 4MHz). The PLL, still runs, and only feeds the USB.
The key is leaving 'PLL' off the master clock selection.

Best Wishes
Krille28



Joined: 08 Nov 2007
Posts: 6

View user's profile Send private message

PostPosted: Wed Nov 21, 2007 5:22 am     Reply with quote

Thanks for the reply. I thing you mean CPUDIV1 (0 do not exist). I have already tried this but then the usb is not recognised in windows.
Ttelmah
Guest







PostPosted: Wed Nov 21, 2007 6:11 am     Reply with quote

Yes, I tend to think in the bit patterns needed by the reister, not CCS 'names'. The division pattern is '00', which as you say is CPUDIV1.

It should work. Make up the fuses in the code, compile, then load the resulting file, into MPLAB (I assume you have this), and see what it says the fuses are set to.
I should show, 'full speed USB clock source', and the CPU oscillator as XT.
I have used this combination before, in a 2450 (not the 2455), without problems.
If your internal CPU clock speed is not terribly critical, you could also select the internal oscillator option.
I'd suspect your problem is actually that at 4MH, the CPU is not keeping up with the speed requirements of the USB, and this is what is giving the failure.

Best Wishes
Krille28



Joined: 08 Nov 2007
Posts: 6

View user's profile Send private message

PostPosted: Wed Nov 21, 2007 6:32 am     Reply with quote

Ttelmah

You were right. It works perfect now. The thing is that you have to reinstall the USB driver (USB to Seriell).

Thanks
Ttelmah
Guest







PostPosted: Wed Nov 21, 2007 7:52 am     Reply with quote

That is slightly 'odd'. Are you sure you are using the same USB port, and that the FSEN fuse is set the same in both programs?.
It shouldn't really need re-installation, but at least it is working now.

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