Thanks for the settings, that allowed me to follow the table in the data sheet and make sence of the settings in the .inc files. This is what I have figured out so far:
I can use DEFINE OSC for 4, 16 and 20Mhz. Anything else I get a compile error, " Integer not previously defined.."
So I used the old reliable 4Mhz XTAL and configured for 16Mhz CPU instead of the 48Mhz in Mackrackit's reply. That worked, but then my DT timer was running at about 1/4 speed. If I put Define OSC back to 4, my timing was fixed.
Did a few more tests and found that I could set the configs to 48, 32,24 or16Mhz, the number of A/D conversions seems to be the same. I always seem to need the Define OSC 4.
Next, was to get the 20Mhz XTAL working, using what I learned from the last 2 hours of testing, I was sure I could plug the 20Mhz in and be set to get back to coding. Nope-not that lucky!
After more time I got it working, then I connected the scope and it stopped working. Seems that connecting the scope to the 20Mhz signal destroys it, don't know if its the extra capacitance from the probes?
The tool that was supposed to help me figure out why I wasn't resonating was causing the issue...go figure.
I also timed the execution speed (number of A/D conversions per second) for different cpu speeds, they all seem the same ( 48, 32 24 and 16Mhz). I left the DEFINE OSC 20 and the DT timer looks spot on.
Seems that the (CPUDIV1:CPUDIV0) must only affect the USB speed? At least for this model of PIC?
Here is what I ended up with:
And it's working, although I'm still confused on the execution speed not changing when changing the (CPUDIV1:CPUDIV0) settings?Code:__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
Thanks for your help, let me know if you have any advice regarding my current confusion.
Shane




Bookmarks