View previous topic :: View next topic |
Author |
Message |
Krille28
Joined: 08 Nov 2007 Posts: 6
|
Problem with oscillator config and USB for 18FL2455 |
Posted: Wed Nov 21, 2007 4:21 am |
|
|
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
|
|
Posted: Wed Nov 21, 2007 5:09 am |
|
|
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
|
|
Posted: Wed Nov 21, 2007 5:22 am |
|
|
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
|
|
Posted: Wed Nov 21, 2007 6:11 am |
|
|
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
|
|
Posted: Wed Nov 21, 2007 6:32 am |
|
|
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
|
|
Posted: Wed Nov 21, 2007 7:52 am |
|
|
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 |
|
|
|