PIC10F222 Rewriting erased OSCCAL value

Thread Starter

jlawley1969

Joined Feb 22, 2021
97
I am trying to run a simple code to use this chip to flash an LED. I have inadvertently deleted the OSCCAL value on 2 chips in a row. I can obviously buy more and not delete this but I just wanted to fix these even if the calibration is not perfect. I am using MPLAB IDE and I am just starting so I have not learned assembly language which I have seen some people use.

I am getting the error "target has invalid calibration data (0x0f)" but the IDE says "the programming has completed"
but when I go to that location (0x0f) it is empty(FFF)
I REALLY just want to know how to overwrite this position with something so I can try what I have seen used in other threads.
thank you
 

MaxHeadRoom

Joined Jul 18, 2013
28,681
You can load the OSCCAL like any other register with a value.
In Assembly it would be e.g. movwf OSCCAL.
See P18 of the manual.
 
Last edited:
Top