How to Reset Osccal Value


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Reset, Restore, or Modify ???

    Hi,

    First ... restoring ( when genuine value is lost) an Osccal value is not so simple.
    The simplest way is to use the Pickit2 ( from µChip ) that has this feature already automated ( see the price, and talk after ... LoL )


    Now Reset ... I suppose it is to write the genuine value to its location ...

    0x3430 means RETLW 30 ( value is $30 )

    DEFINE OSCCAL is just to tell the Pic to read the Osccal value ( does not write anything )

    so, you could use

    ************************************************** ***************************
    END
    '************************************************* ****************************

    @ ORG 3FFh
    @ RETLW 30h

    at the end of your program.

    Note the two last lines must be placed AFTER the END !!!

    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 " !!!
    *****************************************

  2. #2
    Join Date
    Aug 2008
    Location
    British Columbia, Canada
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Thank you Acetronics.

    I added
    @ ORG 3FFh
    @ RETLW 30h
    to the end of my program it compiled and increased the program length from 102 words to 1024 words I assume this is due to the fact that the osccal value is at the end of the chip memory.

    However when I tried to burn the HEX file I get errors. Which leads me to conclude I must have fried part of the chip at some point (like when I plugged it into the breadboard wrong and it got hot and almost burnt my fingers).

    I'll think I'll have to junk this chip but it is extremely helpful to know how to make changes like this, thanks again.


    Also thanks to Pic2008 for pointing out my syntax error.
    -Justin

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