Apart from losing the OSCAL values you've probably also erased the BANDGAP presets.
Firstly, let's deal with OSCAL... the PIC will stilll work, but the internal oscillator will be off by an unknown amount. This OSCAL value is unique to each PIC, so reading mine and giving it to you will be pretty meaningless. If you are going to use an external xtal or resonator then again there is no problem. The problem remains if you are going to use the INTERNAL Oscillator with time critical applications (eg serial comms like SERIN/OUT etc).
Most good programmers have an option to preserve the OSCAL and BANDGAP bits when programming and erasing, and now is the time to ensure yours are set.
There's many methods to tune your OSCAL. Here's some depending on your patience and available hardware...
Method 1. Create a simple program (say LED Blink), set the OSCAL value to mid-way and PIC to have the oscillator output it's clock on OSC2/GP4 with the define...
@ DEVICE pic12F675, INTRC_OSC_CLKOUT
Attach a frequency counter to GP4 and trim your OSCAL value up or down accordingly (yes you need to reprogram the PIC each time) to what the frequency counter is telling you.
Method 2. Create a simple program and have say DEBUG at 4800 in a loop sending a series of 'U's... eg
DEBUG REP "U"\16,13,10
Now, connect to your PC and go thru OSCAL values until you reach a band of values that display the characters properly on your PC. Chose the mid-band value as your final OSCAL.
Now for the BANDGAP. There are only four possible settings, so life is easy. The BANDGAP trims the on-board voltage reference used for BOR and POR. If it's wrong, then most probably BOR and POR won't meet the published specs. Again, write a simple program, say to blink an LED and wind the voltage down on a variable PSU and read on an accurate DVM to see at which point BOR activates. Adjust accordingly.
Personally, it's so much aggrevation for so little gain, I'd put the PIC asside for the first non-critical application or toy I'd need to make, and go buy another one. They're only about $1.50 - so how much time do you want to devote to this?
Melanie
Bookmarks