Hi Drew,
Try changing OSCCON=%11111110 to OSCCON=%11111100. The internal osc is the primary
osc in this configuration since you have it set in your config option. I.E. the intrnal osc is
now considered the primary oscillator.
If you had your config osc setting set for an external osc, then you could switch between
the primary (external osc) & internal osc by setting SCS.1.
Also note that OSCCON bits 2 & 3 are read only, so attempting to write to these bits is not
needed, and, of course, doesn't really change a bit. These bits are read-only and pretty
much just for you to read to determin the oscillator status.
Only registers that show R/W-x are readable/writeable. The x just signifies the default
value of the register bit at POR.
Bookmarks