Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set up 18fx5k50 for use with an internal oscillator?
02-03-2014, 02:38 PM,
#1
How to set up 18fx5k50 for use with an internal oscillator?
I'm trying to figure out how to set up an 18F25k50 in a Pinguino for USB high-speed communication using an internal oscillator. The datasheet suggests that INTOSC should be set to 16Mhz with 3xPLL or 12Mhz with 4xPLL, but neither option seems possible in P8/pinguino/core/oscillator.c (it uses only the low-speed internal oscillator). Would this work instead?

void setup()
{
CONFIG1Hbits.FOSC = 8 // use internal oscillator
OSCON2bits.INTSRC = 1 // HFINTOSC used at the 31.25 khz system clock ref
OSCONbits.IRCF = 3 // set internal RC oscillator freq to 16 Mhz
OSCONbits.SPLLMULT = 3 // 3xPLL
ACTCONbits.ACTEN = 0 // (temporarily) disable active clock tuning
ACTCONbits.ACTSRC = 1 // tune internal oscillator using USB host clock
ACTCONbits.ACTEN = 1 // enable active clock tuning for 16Mhz int osc
}

Also, I assume the schematic of the 18f25k50 using the Bootloader_v4.13_18f25k50_INTOSC.hex file be the same as an 18f2550, except there is no oscillator. Is that correct?
Reply
04-03-2014, 11:28 PM,
#2
RE: How to set up 18fx5k50 for use with an internal oscillator?
Config. bits are defined in the bootloader code, see what I used for the 25k50 in this file : https://code.google.com/p/pinguino32/sou...c/config.h
The Pinguino 25K50 is fully supported by the IDE, just build your board and burn this bootloader : https://code.google.com/p/pinguino32/sou...INTOSC.hex and it should work. You will be also able to use full speed USB.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)