Define osccal_1k 1


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Location
    down south
    Posts
    90

    Default Define osccal_1k 1

    most of my programming is done with 12f629/75 , and 16f630/76
    I have read that it is a good practices to added this define when using OSC
    DEFINE OSCCAL_1K 1
    my ? is do I still need to add
    DEFINE OSC 4
    Code:
      pic12F629
     @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
     
     Define OSCCAL_1K 1         
     DEFINE OSC 4    'INTERNAL CLOCK SPEED 4MH.
    thanks grounded
    " be nice it's people like me that make people like you look smart"
    yes I read the datasheet, of the 300 pages I understood 10

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


    Did you find this post helpful? Yes | No

    Default

    DEFINE OSC and OSCCAL_1K are two different animal.

    DEFINE OSC just define the OSC speed, while OSCCAL call the factory internal oscillator calibration to tweak the accuracy as much as possible.

    Better explanation, and in real English
    http://www.rentron.com/PIC12C67X.htm
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    If you don't use DEFINE OSC 4, the compiler will include it for you in background.
    Steve

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

  4. #4
    Join Date
    Aug 2005
    Location
    down south
    Posts
    90


    Did you find this post helpful? Yes | No

    Default

    thanks for the link
    you second post answered my ?
    I had seen code that had it and some that did not and now I know you just don't have to.
    thanks
    " be nice it's people like me that make people like you look smart"
    yes I read the datasheet, of the 300 pages I understood 10

Similar Threads

  1. Thermo 7 segments - little problem
    By fratello in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 27th July 2013, 07:31
  2. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 13:35
  3. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 03:37
  4. one line led light make image
    By bioul in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 12:19
  5. HSERIN doesn´t work
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th July 2007, 14:23

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