Hi,
The fact that you're using a 12MHz x-tal and DEFINE OSC 48 tells me that you're using the PLL in the chip to increase the frequency from 12 to 48MHz. This by itself seems a bit strange since the maximum operating frequency of the 18F4580 is 40MHz so if you really ARE running at 48MHz you're operating the chip outside of it specifications.
Dropping in a 20MHz x-tal instead of the 12MHz means the PIC is trying to run at 80MHz - twice as fast as it's maximum rated speed.
If it really does use a 12MHz x-tal with the PLL enabled - thus running at 48MHz - and it's doing it reliably then that is as fast as you're going to get.
If it's actually running at 12MHz then what you want is to drop in a 10MHz x-tal and enable the PLL. Then you DEFINE OSC 40.
Please remember that DEFINE OSC never ever changes the speed which the PIC runs at. It only informs the compiler what speed YOU intend to run the PIC at.
/Henrik.
Bookmarks