I have just started programming the PIC 12C508 chip. Anybody know about OSCCAL. I have been doing this:
Origin 0
MOVWF OSCCAL
;rest of program.
I have no idea what that does.
PIC assembly
PIC assembly
Harold L. Reed
Microbes got brains
Microbes got brains
-
- Posts: 40
- Joined: Sun Feb 16, 2003 1:01 am
- Contact:
Re: PIC assembly
Not sure, because I'm just starting myself.<p>But it looks like an OSCillator CALibration command. Don't recall if the 508 has an internal oscillator, so take this with some salt.<p>Michael Fagan
-
- Posts: 40
- Joined: Sun Feb 16, 2003 1:01 am
- Contact:
Re: PIC assembly
Okay, just did some looking. Check your copy of MPLAB for a folder called MCHIP_Tools. Inside you'll find a file called P12c508.inc. That's where your "OSCCAL" command comes from. Since I'm not working with that particular micro, I don't have the data sheet, and can't look up specifically what it does.<p>Michael Fagan
Re: PIC assembly
Oscal is a predefined calibration number specific to that particular batch production. In the Microchip notes are ways in which you may trim that value to get better accuracy for that actual device in your hand.<p>This value should be read by your programmer and stored before you start programming the chip.<p>You only need this value if you are using the internal RC oscillator.<p>As you have seen the INc file has the MOVLW xx
and then rolls over to the reset vector (origin 0) you then can copy W to OSCAL (0x05) or not as you please.<p>I would suggest downloading the data sheet for every part you are using plus the Midrange handbook.<p>Colin
and then rolls over to the reset vector (origin 0) you then can copy W to OSCAL (0x05) or not as you please.<p>I would suggest downloading the data sheet for every part you are using plus the Midrange handbook.<p>Colin
On a clear disk you can seek forever.
Re: PIC assembly
<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>I would suggest downloading the data sheet for every part you are using plus the Midrange handbook. <hr></blockquote><p>If you go to Microchip.com, they'll send you a CD with all the current datasheets and handbooks.
Re: PIC assembly
Thanks everbody.
I have all the data books. You all pretty much say what I was thinking, so I am happy.
The 12C508A has an internal oscillator, so of the 8 pins, I am using 4 for input and 2 for output.
Works fine. Only power and ground are dedicated pins.
I have all the data books. You all pretty much say what I was thinking, so I am happy.
The 12C508A has an internal oscillator, so of the 8 pins, I am using 4 for input and 2 for output.
Works fine. Only power and ground are dedicated pins.
Harold L. Reed
Microbes got brains
Microbes got brains
Who is online
Users browsing this forum: No registered users and 7 guests