16F88 internal clock configuration


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Tgq's Avatar
    Tgq Guest

    Default 16F88 internal clock configuration

    Hi
    I'm looking for internal clock configuration @8MHz
    Thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    There are many options here… so here‘s just one of them…

    1. Ensure that your Device Oscillator Configuration Bits are set to INTRC_OSC_NOCLKOUT (if you don’t know how to do this, see the new FAQ section). This option also means that the two OSC pins are made available for I/O. If you need the Oscillator to output on OSC2, then select the appropriate option (again see FAQ section).

    2. Somewhere at the start of your program (where you normally initialise your processors registers) add the line…

    OSCCON=%01111000

    I refer you to the Datasheet section 4, especially Register 4.2 OSCCON to discover what I have done.

    3. If stabilising your clock to other events is important to you, then you may need to add this piece of code after the above OSCCON setting (otherwise it is not necessary)…

    While OSCCON.2=0:Wend

    This will ensure the PIC does not continue processing until the new Oscillator Frequency is stable by introducing a 4mS delay (see datasheet 4.6.5 item 4).

    As with ALL the queries regarding the set-up of PICs – Read the Datasheet! – it’s all there waiting for you to discover.

  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Question INT_OSC Questions for 16F88

    As I am new to this, reading the data sheets sometimes pose more questions than they answer. Such is with trying to figure out how to use the Internal Osc on the 16F88.

    I am moving from a 16876A where I used and external Osc - and have a program running fine there. Now, I want to move this program to the 16F88, and rather than use external Osc, use an internal. I have recompiled, tweaked the PORT.X settings, and am ready to go, BUT.

    I see the F88 is an 8 mhz OSC, when I was using 4... Sure, I'd like to go faster, but just sticking to the same as the first pic is fine.

    I have seen mention of setting the config bits to INTRC_OSC_NOCLKOUT in the include file.

    As well I have seen advise to use OSCCON=%01111000 at the start - which mapping back to the data sheet looks like it is selecting a speed, but I can't find a table that maps to this..

    I have also seen several references to OSC as RA6, etc... I just simply need to know what to read to find out how to use the internal oscillator and set it appropriately.. anyone have a few mintues to help out with a reply..

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Not quite sure as i didn't see any parts of your code but, if your 8MHZ setting is ok, you also must add DEFINE OSC 8 at the top.. did you?

    for the internal setting, see datasheet in the OSCCON. all the setting are there.

    in your case for 8MHZ
    OSCCON=%01111000

    for 4MHZ
    OSCCON=%01101000

    and so on for the other type of setting
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default OSC settings on F88 .. cont'd

    Much closer.. THANKS!

    I now see data on the LCD and on the 4800b Hyperterm screen, but the numbers are incorrect.. and the routines run differently..

    Where data was reporting '1009', the text tag is fine, but the actual data is different..... like '3345', etc.

    It looks like a timing problem some way?

    Would the config bits effect this?

    TG

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    As we don't have any more info on your current project, it's still hard too see what's wrong with.. BUT at least, since your LCD and your serial communication are working without any kind of garbage display, it's a good sign that your PIC and code are running at the good speed.

    If you did some assembler delay or something using TIMERs you must set your prescallers, rates, and delay with the new crystal speed

    Did you try with the internal 4MHZ setting???
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Feb 2011
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: 16F88 internal clock configuration

    Quote Originally Posted by Melanie View Post
    There are many options here… so here‘s just one of them…

    1. Ensure that your Device Oscillator Configuration Bits are set to INTRC_OSC_NOCLKOUT (if you don’t know how to do this, see the new FAQ section).
    Hi everybody, I have just started to learn about pic programming. My searches through Google end up in this forum most of the time.

    Could you please guide me to this FAQ section mentioned? I tried every FAQ link on the pages but I am unable to find the correct one which will take me to the place where this INTRC_OSC_NOCLKOUT and other options are explained.

    Thanks.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 16F88 internal clock configuration

    I think this is what you are looking for
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Feb 2011
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: 16F88 internal clock configuration

    Quote Originally Posted by mackrackit View Post
    I think this is what you are looking for
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    It is! Thank you.

Similar Threads

  1. 16F88 bootlader with Internal OSC
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 2nd August 2009, 10:15
  2. external clock / internal clock
    By grounded in forum General
    Replies: 4
    Last Post: - 31st May 2008, 17:44
  3. Setting up internal clock correctly?
    By JohnM in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th March 2008, 20:29
  4. 16F688 Internal clock and MCLR
    By manxman in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th August 2007, 18:38
  5. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts