please dont rip this site

On pic power up, the 12C5XX series starts with the program counter at location 1FFh for the 508 and 3FFh for the 509. Whatever instruction is located there is loaded and executed. The osc cal value is either a 6 bit value in the A series (i.e. 12C509A) or a 4 bit number in the non-A series (i.e. 12C509).

The instruction that sits in the 01FF or 03FF location is a MOVLW with the osc cal value. If you dump the memory of a fresh 12C509A for example it will be blank except for location 03FFh which contains in this case 0C9Ch. The MOVLW instruction is 0000 1100 kkkk kkkk. In hex it is 0C kkkk kkkk. The k bits are the osc cal value, in this case 1001 1100. If you look at the osc cal reg you will see that in the A series it contains 6 bits at location 0005h in positions 7-2. That is why the trailing two zeros are there in the binary word. In the non-A part the last nibble is always zero.

So the first thing the processor does on reset is go to 03FF and load 9C into W. The counter increments by one, rolls over to 0000h and executes the next instruction it finds. If you need to use the internal oscillator, then the first thing to do is execute a MOVWF OSCAL and copy W to location 0005h. If you don't need the oscal, then it is overwritten with the first use of W.

To reprogram it back into a JW, in assembly put

org   03FF     MOVLW   9C

in CCS use

#ROM 0x3FF={0xC9C}

file: /Techref/microchip/12c5oscal.htm, 1KB, , updated: 2007/1/18 18:44, local time: 2024/11/5 15:52, owner: SS-DSE-EC8,
TOP NEW HELP FIND: 
3.15.239.209:LOG IN
©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://linistepper.com/techref/microchip/12c5oscal.htm"> microchip 12c5oscal</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?