Searching \ for 'osccal-james' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'osccal-james'.

Truncated match.
PICList Thread
1999\05\10@095626 by Glen

hi james ,

James Cameron wrote:

> Glen wrote:
> > i have a 12c508jw & have tried to read the osscal value prior to
> > programming it.   i can't find the osscal code when i  read the pic
> > when using picprog. it just shows all F's
> If you erased it, then this is what I would expect.  Read it before
> erasing it.  If it's too late, then bad luck.  Either buy another one,
> or ask around for the procedure to re-create it using a test jig.

****************i never programmed it. only tried to read the calibration
value & couldnt

> > since i'll have to install a calibration constant at the beginning of
> > the program (because its a 12c508jw) is this the correct way?
> No.  It should go at the last code location as described in the data
> sheets.  The instruction should be the "movlw" there, and the "movwf"
> should be at 0x00.

****************i read from the microcontroller handbook (2-28)but its
pretty vague( for a beginner that is )sorry but to clarify your statement,
you mean setup like this

config word
       ORG       0x1FF      ;
       ORG       0x000      ; this is what the template shows
       MOVWF     OSCCAL     ;
       GOTO START            ;start of program
 ; rest of code
       MOVLW    CC    ;CC = calibration value (2ND last piece of code)
       end            ;end of code

with thanks , glen

1999\05\10@190634 by James Cameron

Glen wrote:
> James Cameron wrote:
> > If you erased it, then this is what I would expect.
> i never programmed it. only tried to read the calibration
> value & couldnt

Just to clarify; "erasing" the device is when you expose it to an
ultraviolet light source.  "programming" it is when you put it into a
programmer and send code to it.

I suggested you may have erased it and you responded that you had never
programmed it.  Have you erased it?

> you mean setup like this

No, slightly wrong.  I shall change it ...

config word
       ORG       0x000      ;
       MOVWF     OSCCAL     ; store oscillator calibration
       GOTO      START      ; go to start of program
 ; rest of code
       ORG       0x1FF      ;
       MOVLW     CC         ; CC = calibration value
       end                  ; end of the file

The key points to remember are;

       a) the calibration value must be at 0x1ff for 12c508,
       b) the value is to be loaded into the W register,
       c) the CPU starts on reset at 0x1ff and rolls over to 0x000,
       d) if you so desire it, you store W into OSCCAL at 0x000,

James Cameron                                      (

Linux, Firewalls, OpenVMS, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...