Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 20th January 2009, 07:33 PM   #1
Default Recal clock

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
homemade24 is offline  
Old 20th January 2009, 09:37 PM   #2
Default

Quote:
Originally Posted by homemade24 View Post
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.
__________________
Regards,
Sarma.
mvs sarma is online now  
Old 21st January 2009, 02:42 AM   #3
Default

thanks
is that a YES or NO or did it mess something
homemade24 is offline  
Old 21st January 2009, 09:45 AM   #4
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 21st January 2009, 04:53 PM   #5
Default

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
homemade24 is offline  
Old 21st January 2009, 05:19 PM   #6
Default

Quote:
Originally Posted by homemade24 View Post
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
Yes, every time.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Tags
clock, recal

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
what clock does it run at desijays Micro Controllers 9 19th April 2008 09:05 AM
Binary Clock help (sorry for numerous Clock threads) Krumlink Electronic Projects Design/Ideas/Reviews 12 12th September 2007 11:44 PM
LED clock - would appreciate any help lieutenant L Electronic Projects Design/Ideas/Reviews 6 10th February 2006 03:41 PM
Help me on basketball's game clock and shot clock! syaw_007 Electronic Projects Design/Ideas/Reviews 1 6th September 2004 10:50 PM
help with a clock!! ciao_king General Electronics Chat 10 1st August 2004 10:11 AM



All times are GMT. The time now is 06:30 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker