PIC assembly

Electronics Computer Programming Q&A
Post Reply
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

PIC assembly

Post by hlreed » Wed Jun 18, 2003 12:53 pm

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.
Harold L. Reed
Microbes got brains

hamsterears
Posts: 40
Joined: Sun Feb 16, 2003 1:01 am
Contact:

Re: PIC assembly

Post by hamsterears » Wed Jun 18, 2003 3:42 pm

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

hamsterears
Posts: 40
Joined: Sun Feb 16, 2003 1:01 am
Contact:

Re: PIC assembly

Post by hamsterears » Wed Jun 18, 2003 3:54 pm

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

bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Re: PIC assembly

Post by bodgy » Wed Jun 18, 2003 4:50 pm

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
On a clear disk you can seek forever.

chessman
Posts: 292
Joined: Tue Jan 14, 2003 1:01 am
Location: Issaquah, WA
Contact:

Re: PIC assembly

Post by chessman » Thu Jun 26, 2003 7:54 am

<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.

hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: PIC assembly

Post by hlreed » Thu Jun 26, 2003 12:46 pm

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.
Harold L. Reed
Microbes got brains

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests