Introduction
When working with microcontrollers that require a factory calibrated osccal value stored in memory, itΒs very normal that once in a while this setting could be lost during an upload of a new program or when accidentally erasing the device.
IΒm no exception and erased many times this value by mistake in several devices. Once this value is erased, itΒs not possible to recover it unless it was written on a sheet of paper or in our own memory and use it to record it back.
This project has the ability to calculate what is the appropriate osccal value for the 12F675 microcontroller.
Schematic
Parts List
R1 Β Β Β Β Β Β Β Β Β 300 ohms resistor
R2 Β Β Β Β Β Β Β Β Β 1K ohms resistor
R3Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β 10K ohms resistor
P1 Β Β Β Β Β Β Β Β Β 10K Potentiometer
C1 Β Β Β Β Β Β Β Β Β 15pF capacitor
C2 Β Β Β Β Β Β Β Β Β 15pF capacitor
C3 Β Β Β Β Β Β Β Β Β 10uF capacitor
Led1 Β Β Β Β Β Β Β 3mm green led
LCD Β Β Β Β Β Β Β 8X2 LCD
XTAL Β Β Β Β Β Β 8Mhz cristal
IC1 Β Β Β Β Β Β Β Β 16F88 microcontroller from Microchip
S1 Β Β Β Β Β Β Β Β Β Push button
Others:
Box
8 PIN IC SOCKET
PCB
Hex program for the microcontroller
How it works
The program loaded in the 12F675 device which has no osccal value will force a pulse on GPIO.4 and it will make a loop while increasing the osccal value internally.
GPIO.5 will send the current osccal value used for each pulse sent. Because the device has no calibrated osccal value, the pulse will be variable. The circuit will wait until it receives the correct pulse. When the correct pulse is received, it will stop the test and display the osccal value used when the correct pulse was measured.
Β
The value displayed is in Hexadecimal format which means it can be used without conversions directly to the deviceΒs memory.
For more detail: OSCCAL Value Finder