Connect with us


Discussion in 'Electronic Design' started by merco, Oct 5, 2007.

Scroll to continue with content
  1. merco

    merco Guest

    Hi i'm using INTRC with 16F88 @ 8 MHz.

    Is there a way to check (in the pic program) that internal clock is
    really at 8MHz ?

    I have some problems with usart at 38400 and I think is due to wrong
    data rate clock.

    Thank you
  2. Tom2000

    Tom2000 Guest

    Look at page 35 of the 16F88 data sheet. If you set your oscillator
    configuration to INTIO1, the clock/4 will appear on RA6.

    In addition to setting the oscillator configuration, you need to set
    the OSCCON register to 0x72. (See p. 40 of the data sheet.)

    Good luck!

  3. James Beck

    James Beck Guest

    I didn't think using the internal RC oscillator to run the UART was an
    accepted practice. I would expect to see exactly what you are seeing,
    bad timings at the higher data rates. I would think even a cheap
    ceramic resonator would be more stable than an RC oscillator.

  4. It depends on the chip.
    The older RC oscillators, were far too inaccurate for async serial.
    Current ones on some chips have accuracies warranted to a couple of
    percent, and better than this over 'typical' temperature ranges. The
    16F88, _should_ be good enough, provided the supply is within the range
    2.7 to 3.3v, and you are in a normal 'room temperature' enviroment.
    Outside this, it is not accurate enough.

    Best Wishes
  5. merco

    merco Guest

    thanks to all...
    The same programs runs always OK with a 8Mhz Xtal....
  6. You have this in there, right?

    bsf STATUS, RP0 ;Switch to Bank 1
    movlw b'01110000' ;Set internal osc to 8Mhz
    movwf OSCCON
    bcf STATUS, RP0 ;Switch back to Bank 0
  7. Tom2000

    Tom2000 Guest

    fOn Mon, 8 Oct 2007 09:46:01 -0500, "Anthony Fremont"
    I think you just turned off the internal oscillator. Try b'01110010'

  8. No, I didn't turn it off. When the bottom two LSBs are zero, the _CONFIG
    word determines the type of oscillator. So as long as the _CONFIG word is
    properly set, then 0x70 is the proper value to put into OSCCON. The code I
    provided was snipped from a working program.
  9. Tom2000

    Tom2000 Guest

    Thanks - good to know!

    I've always used 0x72 when I run the internal oscillator. It never
    occurred to me to try anything else.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day