PIC16F676 <= Why does this program not work? ..#2

John P

Joined Oct 14, 2008
What does your program do, and have you read the data sheet section

The PIC16F676 is an obsolete part, anyway. You'd do better to switch to something more modern. Microchip says "Newer device available PIC16F18324".

Ian Rogers

Joined Dec 12, 2012
The OSCCAL is normally at 0x3FF and can only be fetched.. If it is missing you have to re-cal the figure with pickit 2.

then in XC8 you use OSCCAL = __osccal_val();
No Idea in Mikro C
On the web folk are using asm.
bsf STATUS, RP0 ';Bank 1 
call 0x3FF ';Get the cal value 
movwf OSCCAL ';Calibrate 
bcf STATUS, RP0 ';Bank 0 
end asm
There was an issue with finding the OSCCAL reference in MikroC so just make it known by putting a line in your codebefore the asm routine