Page 1 of 1

unable to set config bits

Posted: Sat Sep 02, 2017 3:04 am
by JFinlayson
Hi I have write config on download flag set in Project options dialog, configure. But unable to change internal oscillator speed or no matter what oscillator I set pic 8 keeps running at 1Mhz. So looks like I am unable to set configuration bits.
I am using latest version of Flowcode 7 and latest version of Microchip XC8 V1.4 compiler. Is there any other way to send configuration to chip?

Re: unable to set config bits

Posted: Sat Sep 02, 2017 6:03 am
by QMESAR
Hi
Are you setting the OSCON Register with the flowcode Oscillator Helper or you have to do it with a C code component
if you can post a minimum project then we could help you

Re: unable to set config bits

Posted: Sat Sep 02, 2017 10:53 pm
by JFinlayson
I set the oscillator speed in project options, general options as in program attached
RAT440.fcfx
(11.66 KiB) Downloaded 303 times

Re: unable to set config bits

Posted: Sat Sep 02, 2017 11:30 pm
by kersing
The setting in project options just tells Flowcode what speed the oscillator is set to. It does not set the value on chip. To actually configure the oscillator on the chip you need to use a C code icon and set the PIC registers to the correct values.

The code to use the internal oscillator at 8 MHz for your device should be:

Code: Select all

OSCCON = 0b01110011;

Re: unable to set config bits

Posted: Sun Sep 03, 2017 9:11 pm
by JFinlayson
Ok Thanks is it just the oscillator speed setting that is not sent?
I presume the other config bits are programmed?

Re: unable to set config bits

Posted: Sun Sep 03, 2017 10:59 pm
by kersing
Oscillator speed is not part of the configuration bits, it is a separate register. The configuration bits are programmed.