12C671 & Osccal register - I am confused


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251

    Exclamation 12C671 & Osccal register - I am confused

    Merry Christmas to everyone
    I am having a small problem which I would like to ask.
    I am using 12C671 & my fuse settings are the following ones:
    Code:
    DEFINE NO_CLRWDT
    DEFINE OSC 4
    @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF
    I just want to run the PIC at 4MHz. I do not understand how to implement bits of the OSCCAL register. Mainly bits 4 to 7.
    I read the PBP manual and it advises to put one of the two defines in the program: Define OSCCAL_1K 1 & Define OSCCAL_2K 1

    I am confused as to if I put Define OSCCAL_1K 1 on top of the code, do I need any other supporting statement in the fuse setting section like may be setting bits 4-7 of OSCCAL register? OR Will my PIC will run at 4MHz just by adding this define statement only?
    Can someone guide me please?
    Thanks
    Last edited by Megahertz; - 25th December 2009 at 23:22.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Check what BRUCE said here, I think it applies to your project.
    http://www.picbasic.co.uk/forum/showthread.php?t=1466
    http://www.picbasic.co.uk/forum/showthread.php?t=11771
    As for OSCCAL, BITs 7:4 adjust how much change and BITs 3:2 Determine which direction. Data Sheet 4.2.2.7 OSCCAL REGISTER
    Also Dave comments here:http://www.picbasic.co.uk/forum/showthread.php?t=12265
    Get <b>this version</b> of google, you can search <b>just this forum with it, </b>or the whole internet:
    http://www.google.com/custom?hl=en&c...ch&sitesearch=
    Last edited by Archangel; - 26th December 2009 at 06:15.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Can anyone help a newcomer?
    By scopit in forum Schematics
    Replies: 18
    Last Post: - 20th October 2009, 09:23
  3. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  5. MX7705 or AD7705 experience
    By FM11 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th January 2006, 21:54

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