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.

Recal clock

Status
Not open for further replies.

homemade24

New Member
I just added
bsf STATUS, RP0 ;Bank 1
call 3FFh ;Get the cal value
movwf OSCCAL ;Calibrate
bcf STATUS, RP0 ;Bank 0
had to to get the code working right
If I'm thinking right (that's scary) depending were you put this in the code
the clock could only be recal @ programming or could be recal everytime the chip is powered up. if so which is the standard way of doing it. and is it a problem if you recal every time the chip is powered up
thanks
 
I just added
bsf STATUS, RP0 ;Bank 1
call 3FFh ;Get the cal value
movwf OSCCAL ;Calibrate
bcf STATUS, RP0 ;Bank 0
had to to get the code working right
If I'm thinking right (that's scary) depending were you put this in the code
the clock could only be recal @ programming or could be recal everytime the chip is powered up. if so which is the standard way of doing it. and is it a problem if you recal every time the chip is powered up
thanks

Please see this link
12F675 tutorial 3 : Adding a PIC Serial port.
 
It's absolutely critical that you don't erase the calibration value at 0x3FF - any decent programmer shouldn't allow you to do this, it should read and restore the value automatically.

The code for setting the calibration value is normally placed right at the beginning of the program to ensure it's set whenever the PIC boots up.

Bear in mind this isn't 'calibrating' the chip, it's simply using the value from when it was calibrated back in the factory.
 
thanks Nigel
that clears it up and I guess calibrate was was not the correct term
it's more go get the factory setting and it need to do that with every boot up
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top