How to Reset Osccal Value


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,

    You sure ???



    Alain
    Yes, I'm sure. greensasquatch pointed that the original value from the chip is 30H.

    greensasquatch, without writing @ ORG 3FFh and @ RETLW 30h, have you tried the method I have written here?

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Hi,

    Not so sure ...

    as you write the cal value in a "non protected" memory location and not at the end of the program memory ...

    you'll lose the cal value if you use the '675 for another program.

    so it's much better to write it at the end of the program memory, as programmers will read it ( and preserve it ) if you do not remember what you had done ... some weeks later.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Here is a copy / paste from one of my programs 12F675:
    Code:
    POKECODE @$3FF, $50  ' reintroduces osscal correction data
                             ' $3FF tells it where to code, $50 is the
                             ' Cal value unique to each individual chip.
    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.

  4. #4
    Join Date
    Aug 2008
    Posts
    66


    Did you find this post helpful? Yes | No

    Thumbs up

    Quote Originally Posted by Acetronics View Post
    Hi,

    Not so sure ...

    as you write the cal value in a "non protected" memory location and not at the end of the program memory ...

    you'll lose the cal value if you use the '675 for another program.

    so it's much better to write it at the end of the program memory, as programmers will read it ( and preserve it ) if you do not remember what you had done ... some weeks later.

    Alain
    There are two ways of doing it, either write to the OSCCAL directly or like you said, write at the end of program memory at 0x3FF.

    Good point.

Similar Threads

  1. IC12F508 with Internal Oscillator and Software Reset
    By karan123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd October 2009, 16:13
  2. pic reset sometimes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd January 2008, 17:27
  3. Software Driven Reset Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2005, 00:53
  4. reset and interrupt vectors
    By dtoohey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2005, 22:02
  5. Replies: 5
    Last Post: - 1st December 2004, 12:49

Members who have read this thread : 1

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