|
|
View previous topic :: View next topic |
Author |
Message |
andromeda92
Joined: 21 Jul 2017 Posts: 16
|
PIC18F4550 at 48Mhz |
Posted: Mon Jul 24, 2017 11:06 am |
|
|
Hi,
How i configure #FUSES for 48Mhz ?
I have tested all possibility but it don't work
i have a crystal 16Mz
Code: |
#FUSES HSPLL
#FUSES CPUDIV2
#FUSES PLL1
#use delay(clock=48Mhz)//,crystal=16Mhz)
|
Code: |
#FUSES XT
#use delay(clock=48Mhz)//,crystal=16Mhz)
|
must i add crystal=16Mzh at #use delay ?
any idea for configurint this chip at 48 Mhz ?
Thanks in advance. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Mon Jul 24, 2017 11:21 am |
|
|
You need to use CPUDIV1.
The CPUDIV fuses are slightly complicated.
There are four divisor patterns.
00 01 10 11
When running off the crystal directly, these give /1, /2, /3 & /4
These are called by CCS CPUDIV1, CPUDIV2, CPUDIV3 & CPUDIV4.
However, when fed from the PLL, these same patterns give /2, /3, /4 & /6.
Personally I wish that CCS called them CPUDIV00, CPUDIV01, CPUDIV10 & CPUDIV11, with a note to look in the data sheet for what division ratio these actually give....
If your crystal is 16MHzx, you need to use PLL4. You have to be dividing the crystal down to 4MHz to feed the PLL.
So:
Code: |
HSPLL, CPUDIV1, PLL4
#use delay (CLOCK=48MHz)
|
|
|
|
andromeda92
Joined: 21 Jul 2017 Posts: 16
|
|
Posted: Mon Jul 24, 2017 12:08 pm |
|
|
Thanks for your explication. |
|
|
|
|
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
|