View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 05, 2007 5:51 pm |
|
|
I don't have an 18F4520 to test, but I believe the following fuse
settings will put it into 4x PLL mode with an external 10 MHz
crystal or oscillator.
Code: |
#include <18F4520.h>
#fuses H4, NOWDT, PUT, BROWNOUT, NOLVP
#use delay(clock=40000000)
//====================================
void main()
{
while(1);
} |
|
|
|
Frosty Guest
|
|
Posted: Mon Feb 05, 2007 5:55 pm |
|
|
Yes indeed. The H4 makes all the difference. Thank you. |
|
|
neverlog
Joined: 02 May 2010 Posts: 36
|
|
Posted: Thu Jul 22, 2010 10:13 pm |
|
|
Frosty wrote: | Yes indeed. The H4 makes all the difference. Thank you. |
I have tested with 10Mhz Crystal + H4, Delay Clock =40Mhz, but seems like the same speed like 20Mhz crystal alone(Delay Clock =20Mhz).
I wonder someone did test it out. For me no different at all.
Feel free to comments |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jul 22, 2010 10:16 pm |
|
|
Are you using an 18F4520 ? And what compiler version ? |
|
|
neverlog
Joined: 02 May 2010 Posts: 36
|
|
Posted: Fri Jul 23, 2010 2:36 am |
|
|
PCM programmer wrote: | Are you using an 18F4520 ? And what compiler version ? |
Yes. I am using 18F4520, my compiler is 4.104.
I am testing the for loop with fix loop value let say 2048 round.
I found that the time the PIC need to finish the loop is same for (H4, 10Mhz) and (20Mhz alone).
Not much different. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19518
|
|
Posted: Fri Jul 23, 2010 4:13 am |
|
|
You do realise, that if your loop contains a delay (*as shown in your example), the delay _will_ remain the same length, with each different oscillator setting?. The whole 'point' of the clock statement, is that that the compiler then knows how to adjust the internal loops used, to give the same time.
Best Wishes |
|
|
neverlog
Joined: 02 May 2010 Posts: 36
|
|
Posted: Sat Jul 24, 2010 3:40 am |
|
|
Ttelmah wrote: | You do realise, that if your loop contains a delay (*as shown in your example), the delay _will_ remain the same length, with each different oscillator setting?. The whole 'point' of the clock statement, is that that the compiler then knows how to adjust the internal loops used, to give the same time.
Best Wishes |
Hi Ttelmah, that is not my example code.
I didn't post my code. It's just as simple code with loop for comparing 2048 records in the 24LC256 memory module.
Perhaps reading and compare data from 24LC256 already has limit itself. |
|
|
|