|
|
View previous topic :: View next topic |
Author |
Message |
theteaman
Joined: 04 Aug 2006 Posts: 98
|
18LF25k22 oscillator too fast |
Posted: Wed Jan 02, 2013 1:50 am |
|
|
Hi
I am using an 18LF25K22 with the fuses
Code: |
#use delay(clock=20000000, crystal=20000000)
#fuses NOWDT, WDT128, HSH, NOIESO, BROWNOUT, PUT, NOSTVREN, NODEBUG, NOLVP, NOEBTR, NOCPB, NOEBTRB, NOWRTC, NOWRTB, NOFCMEN, NOPBADEN
|
and a 20MHz crystal. I set a pin to alternate between high and low every 5000 milliseconds with delay_ms(5000). But on my scope I can clearly see the signal's period is just over 1 second...
VDD is 4.5V.
I'm curious as to why it just won't go at the right speed? Any help appreciated, thanks. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Wed Jan 02, 2013 2:30 am |
|
|
Add NOPLLEN
The default fuse has the PLL enabled, _unless_ you say otherwise. You can always tell by looking at the bit patterns selected at the end of the .LST file, and checking these against the data sheet. It is designed to confuse, since on most chips the default is for the PLL to be 'off'.
Impressive actually that the chip runs at 80MHz.... ;)
Best Wishes |
|
|
theteaman
Joined: 04 Aug 2006 Posts: 98
|
|
Posted: Wed Jan 02, 2013 2:41 am |
|
|
You sir, just saved me hours more confusion! Thank you! I never thought that the PLL default could be different for different devices.
Thanks again. |
|
|
|
|
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
|