CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

OSCCAL bit calibration

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Vovachess



Joined: 15 Mar 2004
Posts: 33
Location: Swiss

View user's profile Send private message Visit poster's website ICQ Number

OSCCAL bit calibration
PostPosted: Wed Jan 04, 2006 3:46 am     Reply with quote

Hello.

How correctly to calibrate oscillator to 4Mhz of PIC10F204? There is calibration word saved at 0xFF. What to do with it? How does software must look like?
Thanks
Ttelmah
Guest







PostPosted: Wed Jan 04, 2006 5:57 am     Reply with quote

You do nothing.
When the chip wakes up, it actually resets to the top location in memory. This instruction executes, and transfers the factory calibrated value, into the W register. It then 'rolls over', and starts executing at address 0. The compiler automatically transfers this byte, into the OSCCAL register for you. The only thing you need to do, is, whenever you program the chip, you must make sure your programmer is set to save this byte.
If you look at the listing file the compiler generates, you will see, something like:
Code:

*
0000:  MOVWF  05
0001:  GOTO   016


The first instruction here, copies the value that has been passed from the configuration location, into the OSCCAL register, nd the code then jumps into it's 'main' program.

Best Wishes
Vovachess



Joined: 15 Mar 2004
Posts: 33
Location: Swiss

View user's profile Send private message Visit poster's website ICQ Number

PostPosted: Wed Jan 04, 2006 8:52 am     Reply with quote

Thanks
I cheched hex file.
It works.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group