No announcement yet.

PIC18F2550 Internal Oscillator Configuration

  • Filter
  • Time
  • Show
Clear All
new posts

  • PIC18F2550 Internal Oscillator Configuration

    I am trying to get a PIC18F2550 to operate it's internal oscillator for one of my projects. Initially I'm just trying to blink an LED. Running a 20Mhz external crystal works fine. I tried modifying the pic18F2550.INFO file with no success. I'm not sure which settings need to be changed and to what options in the .INFO file. Also, would I need to set OSCCON in my code? How would I determine it's value? I don't quite understand the datasheet. And do I need to define OSC to either 4 or 8 to get accurate pauses? I would appreciate any assistance. Thanks.

  • #2
    The .INFO file doesn't affect the compilation. It is supplied for your convenience when constructing a #CONFIG block to set configuration in your program.

    The oscillator structure is quite complex on the 18F2550 because of the need for specific frequencies to drive the USB peripheral. I don't think the internal oscillator can be routed to the USB peripheral at all.

    Are you saying that the USB peripheral is not being used? You just want the 2550 to behave as would a PIC without USB?
    Charles Leo
    ME Labs, Inc.


    • #3
      Yes, I am NOTusing the USB peripheral.


      • #4
        Thank you Charles for sending me the code for running a pic18F2550 with internal oscillator. It works fine! I understand now that you need to set OSCCON to %01100000. It looks like IDLEN, OSTS, IOFS, and SCS1:SCS0 can all be set to 0 and bits 6 - 4 is set to 110 for 4 MHz. In addition, the #CONFIG can be added to the code instead of modifying the .INFO file if I understand correctly.