Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Erasing PIC - factory OSSCAL, oscillator calibration value

Status
Not open for further replies.

max0412

Full Member level 5
Full Member level 5
Joined
Oct 26, 2003
Messages
251
Helped
34
Reputation
66
Reaction score
5
Trophy points
1,298
Activity points
1,999
erasing pic

I have a couple of ? regarding eraseing PIC's


When you erase a PIC to reprogram it in MPLAB does it erase the factory OSSCAL value?

How can you check if it still has the factory oscillator calibration value?

How do you erase it for reprogramming without erasing the factory oscillator calibration value?

I've been just useing the icon pictured below it's greyed out now "Erase the target device" fith icon from the left, does this erase the factory calibration value.

xpndrr.png


Thanks
 

Re: Erasing PIC's

If you are using ICD-2, then in the Programmer Settings... menu you will get to this window, under the Calibration memory tab. As you can see, if you leave the box unchecked, the cal memory will be preserved.

To check the cal memory, simply read the PIC and then look at the last location. If it contains a movlw instruction, the cal value is still there; if it reads 3FFF, then it has been erased.
 

    max0412

    Points: 2
    Helpful Answer Positive Rating
Erasing PIC's

The data sheet normally warns you that you should read the pic first before erasing it so you can store the osc cal value and then use it later when programming.
I wouldnt worry about it to much though, just program 0 there, thats the nominal value. A few hertz this way or that way wont make any difference.

If your application is very frequency dependant, use a xtal.
 

    max0412

    Points: 2
    Helpful Answer Positive Rating
Erasing PIC's

When I was Testing many Pic programmers there was the constant risk of erasing the Oscal Value and the Bandgap at the Configuration word... so for me, it`was very useful to read both values and write them at the bottom of the PIC (with warker or so) so If I erased those values (by mistake) I recover the values just looking at the pic...

So I sugest to read and memorize those values BEFORE doing something risky.

Also... Good Programmers read thy OSCAL value even without asking to you...

Also, for most pics. the Oscal Value is near 80h not 0
(as the datasheet mentions 80h is the mid value, higher values are for higher frecuencies, lower for lower :p) also 80h is the reset value of OSCAL register...
 

    max0412

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top