There is a long explanation about it in general here: http://www.picbasic.co.uk/forum/showthread.php?t=543
But if you look at the last couple posts, you will see some talk about what you describe.
The newer chips use OSC in their .inc file, so when you say OSC = 4, it sort of breaks things. (If you really want OSC = 4, just leave that out, and it will default to 4mhz).
Take a look at the PIC18F46j11.inc file, and you will see:
Code:
; Oscillator:
; OSC = INTOSC INTOSC
; OSC = INTOSCO INTOSCO (CLKO-RA6)
; OSC = INTOSCPLL INTOSCPLL
; OSC = INTOSCPLLO INTOSCPLLO (CLKO-RA6)
; OSC = HS HS
; OSC = HSPLL HS+PLL
; OSC = EC EC (CLKO-RA6)
; OSC = ECPLL EC+PLL (CLKO-RA6)
One way around it is Bruce's suggestion. I have tried it, and it works. However, it will break other include files that use the OSC setting to set timer speeds, etc. But if you rename your modified code, you can always change it back.
I see this as Microchips problem of changing things on the fly. They seem to make it hard for their 3rd party vendors to try to keep up. In this case, it seems difficult for MeLabs to come up with a perfect solution, but we will see.
Bookmarks