|
|
View previous topic :: View next topic |
Author |
Message |
Vovachess
Joined: 15 Mar 2004 Posts: 33 Location: Swiss
|
OSCCAL bit calibration |
Posted: Wed Jan 04, 2006 3:46 am |
|
|
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
|
|
Posted: Wed Jan 04, 2006 5:57 am |
|
|
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
|
|
Posted: Wed Jan 04, 2006 8:52 am |
|
|
Thanks
I cheched hex file.
It works. |
|
|
|
|
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
|