1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

"Internal" Oscillator of a PIC18F2550

Discussion in 'Microcontrollers' started by KansaiRobot, Jan 28, 2010.

  1. KansaiRobot

    KansaiRobot Member

    Joined:
    Jan 14, 2010
    Messages:
    210
    Likes:
    2
    Location:
    Kyoto Japan
    Hello everybody

    I would like to ask a question about the oscillator in a PIC18F2550.
    I have a board in which the pin 9 and 10 are already connected to a crystal of 20 MHz connected to ground through two caps of 22 pF.

    Is this an External oscillator??

    when in a program we refer to an "internal" oscillator" does this refer to a oscillator "inside" the microcontroller???

    if we put "clock to be derived from the internal oscillator (as in #pragma config FOSC=INTOSCIO_EC
    or CONFIG FOSC=INTOSCIO_EC)
    what are we refering to???

    Does the microcontroller have an oscillator "inside"???

    Does the oscilator I see in the circuit of my board is an "external oscillator"??

    if yes, which should I use??

    thank you very much for all the help you can give me

    Kansai
     
  2. Wond3rboy

    Wond3rboy Member

    Joined:
    Jun 25, 2008
    Messages:
    762
    Likes:
    7
    Location:
    Sindh,Pakistan
    Many PIC micros come with internal oscillators already inside them.It varies from 4MHZ to i think 16MHZ(using internal PLL).

    FOSC=INTOSCIO_EC means internal oscillator for micro controller with RA6 acting as a port pin,External oscillator used as USB clock source(see the timing accuracy statement below).

    If you have an eternal oscillator already connected then use the external one because its less susceptible to external variations like temperature(for high accuracy).But if you are using a prototype board i suggest you go with the config settings that are being advised.Otherwise it shouldnt cause a problem.

    Refer to page 282 and 25 of the 18f2550 datasheet.
     
  3. Aussie Susan

    Aussie Susan New Member

    Joined:
    Jan 5, 2010
    Messages:
    52
    Likes:
    4
    If you just had the crystal and capacitors connected directly to the pins of the PIC, then that is an "internal" oscillator - the active parts of the oscillator are still internal to the PIC chip. All the crystal does is determines the frequency of the oscillator.

    I've used the PIC18F4550 which has the same data sheet and it is quite clear about the difference between internal and external oscillators. The internal ones need 2 connections for the crystal/resonator to the OSC1/OSC1 (or T1OSO/T1OSI) pins but the active components are inside (internal) to the chip. There is also an RC internal oscillator that can provide a 31KHz clock signal.

    An external oscillator has all of the active and passive components outside of the PIC chip, so you have to generate the clock signal yourself in some way. Also these external oscillators only require a single pin (the OSC1 pin) which leaves the other pin free to be an I/O pin or to send out the Fosc/4 clock signal used internally so tnat you can synchronise other circuitry with the PIC's clock.

    Susan
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. KansaiRobot

    KansaiRobot Member

    Joined:
    Jan 14, 2010
    Messages:
    210
    Likes:
    2
    Location:
    Kyoto Japan

    Thank you very much for the replies :)
     
    Last edited: Jan 29, 2010
  6. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,024
    Likes:
    317
    Location:
    Brisbane Australia
    ONLINE
    When Microchip refer to an internal oscillator they mean one with no external parts. To avoid confusion when referring to any other oscillator rather than the internal RC one they refer to it by name, IE Crystal, external RC etc. The internal RC oscillator on the 2550 can be switched between 8 different frequencies between 32k and 8MHz. However, if you are going to use the USB capabilities you must you a crystal or resonator. See the diagram in the data sheet.

    Mike.
     
  7. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    If you plan to use USB then you'll need an external crystal. The internal RC clock is not accurate / stable enough.
    4, 20 & 24 MHz are popular choices for USB enabled PICs
     

Share This Page