How to Reset Osccal Value
I've done a fairly thorough search in the forum already on osccal. Because of this i now know how to read the value from my chip and to write it on the bottom using liquid paper before I erase anything (thanks!).
My problem is that while my programmer PICPgm usually leaves osccal alone when programming this last write it has has changed the value on me and I cannot figure out how to get it back.
The value i originally read from my 12f675 was "0x3430" (now shows 0x34FF) and from what I have read in the forums the last two digits "30" is the osccal value.
From reading the PBP Manual I see that to restore a value one uses something like:
DEFINE OSCCAL = $a0 '(though I replaced a0 with my value of 30)
However when I try to compile this I get a syntax error.
I'm sure this is something simple and it would be nice to have the correct method documented here for newbies such as myself.
Thanks
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