2012-11-06, 06:40:14
(This post was last modified: 2012-12-25, 17:14:37 by Mikael Gustavsson.)
Hey folks:
An fyi for anyone wanting to use the PIC18F27J13 -- I easily got it running with the loader. It was great to move up to 128KB (from 64KB of the pic18F26K22). I did find a note in the errata sheet about a problem trying to use the 4X PLL -- even with an external xtal or clk input the internal osc divider needs to be set to keep the PLL happy. I am using it with a 12MHz xtal and the 4x PLL for 48MHz cpu clock. Don't forget to change the freq in the settings.inc file to the cpu freq or your baud rate is wrong and it won't download.
; this patch goes in the user-code.inc file:
; tweak: 18F27J13 errata sheet patch: set int osc divider to 8MHz
; or else the 4x PLL will not work (so we load OSCCON reg here)
;;;;in C this is sorta:
;;;;#define OSCCON 0xFD3 // bits-6-4 are Int Osc Freq Select bits
;;;;OSCCON = OSCCON | 0x70; // set int osc divider to 8MHz
MOVLW 0x70
IORWF 0xFD3,1
enjoy all that new rom space!
An fyi for anyone wanting to use the PIC18F27J13 -- I easily got it running with the loader. It was great to move up to 128KB (from 64KB of the pic18F26K22). I did find a note in the errata sheet about a problem trying to use the 4X PLL -- even with an external xtal or clk input the internal osc divider needs to be set to keep the PLL happy. I am using it with a 12MHz xtal and the 4x PLL for 48MHz cpu clock. Don't forget to change the freq in the settings.inc file to the cpu freq or your baud rate is wrong and it won't download.
; this patch goes in the user-code.inc file:
; tweak: 18F27J13 errata sheet patch: set int osc divider to 8MHz
; or else the 4x PLL will not work (so we load OSCCON reg here)
;;;;in C this is sorta:
;;;;#define OSCCON 0xFD3 // bits-6-4 are Int Osc Freq Select bits
;;;;OSCCON = OSCCON | 0x70; // set int osc divider to 8MHz
MOVLW 0x70
IORWF 0xFD3,1
enjoy all that new rom space!