Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Internal Oscillator Recalibration

Status
Not open for further replies.

sahu

Member
PIC 16f676 ... Problems arise if by accident or otherwise, the program memory at address 0x3FF is erased or over written. Since the calibration value is unique to each individual PIC there is no way to know what it was, but it may possible to recover it by recalibrating against a known frequency ?
 
Last edited:
Hi Sahu, if you need to recover the calibration value you can write some simple code to output a frequency at 10% of the osc frequency then measure using a frequency meter;
Code:
loop:
 bsf PORTB.0
 nop;
 nop;
 nop;
 nop;
 bcf PORTB.0
 nop;
 nop;
 nop;
 goto loop;

Then try inputting a few different cal values until you get it close enough. It only takes a few minutes.
 
I tried with pickit2 programmer, it doesnt work :(

thank you!
marC:)

It work you have to no how to do it. If it not working for you you have the pickit2 data and clock being held high with your hardware

Rb idea would be the simple way to go all the code in the Link is doing is counting the 60 hz toggle and figuring if your osc is running at the right speed to get a proper count.

If you have a PICkit 2 programmer, get version 2.50 (or later) software from the Microchip website. This includes a menu option to recalibrate and reprogram the OSSCAL setting in one operation.

shau you can try doing like the link you posted but the hex will not work with your chip and I don't think they supply the source code
 
I've reset some chips using the auto reset osccal and some I had to do more then one time. But I have found that it is easy if you don't have the chip data and clock hooked to any thing but the pickit2. If there pulled high it will not reset it. And some chips I had to regenerate it then load the chip manually
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top