Searching \ for '[PIC]: Oscillator calibration for PIC12ce519' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=oscillator
Search entire site for: 'Oscillator calibration for PIC12ce519'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Oscillator calibration for PIC12ce519'
2001\11\27@143135 by Martin Johansson

flavicon
face
So, I forgot the [PIC]: "prefix" at the beginning of the subjectline in my previous post, sorry for that! :/

I'm just about to start a small project using two PIC12ce519 devices (UV-erasable). I have been looking around for information about the oscillator calibration value that seems to be preprogrammed into these.
But I don't really get how I should get the value from and later into the device using MPLAB IDE. Any help
would be greatly appreciated.

/Martin Johansson

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\11\27@164643 by Drew Vassallo

picon face
>I'm just about to start a small project using two PIC12ce519 devices
>(UV-erasable). I have been looking around for information about the
>oscillator calibration value that seems to be preprogrammed into these.
>But I don't really get how I should get the value from and later into the
>device using MPLAB IDE. Any help
>would be greatly appreciated.

I would imagine that this is in the datasheets, as it is in the 12C67x
datasheet.

all I've done is this:

ORG     0x000             ; processor reset vector
call    0x3FF                   ; get OSCCAL calibration value
bsf     STATUS, RP0
movwf   OSCCAL          ; load calibration value for proper frequency
goto    Begin             ; go to beginning of program

Note that the 0x3FF location might be different for your chip.  It's the
last program memory location.  Issue a call to it and load it into the
calibration register.  Also note that these instructions fit into locations
0x000 thru 0x003, leaving the next location free as the default for your
interrupts.

Re-check the datasheet because I would bet money on the fact that it's
there, somewhere.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2001\11\27@173002 by Tony Nixon

flavicon
picon face
Drew Vassallo wrote:
>
> all I've done is this:
>
> ORG     0x000             ; processor reset vector
> call    0x3FF                   ; get OSCCAL calibration value
> bsf     STATUS, RP0
> movwf   OSCCAL          ; load calibration value for proper frequency
> goto    Begin             ; go to beginning of program

Why the bsf STATUS,RP0 when OSCAL is in RAM address 0x05.

RP0 is defined as PA0 in the 12C5xxx chips.

It doesn't look like you set access back to page 0.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamKILLspambubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2001\11\28@071412 by Dwayne Reid

flavicon
face
At 04:46 PM 11/27/01 -0500, Drew Vassallo wrote:
>>I'm just about to start a small project using two PIC12ce519 devices
>>(UV-erasable). I have been looking around for information about the
>>oscillator calibration value that seems to be preprogrammed into these.
>>But I don't really get how I should get the value from and later into the
>>device using MPLAB IDE. Any help
>>would be greatly appreciated.
>
>I would imagine that this is in the datasheets, as it is in the 12C67x
>datasheet.
>
>all I've done is this:
>
>ORG     0x000             ; processor reset vector
>call    0x3FF                   ; get OSCCAL calibration value
>bsf     STATUS, RP0
>movwf   OSCCAL          ; load calibration value for proper frequency
>goto    Begin             ; go to beginning of program

Note the above will NOT work on the 12ce519!  It is a 12 bit core device,
not 14 bit.

But I think you are answering the wrong question.

To read the calibration value from your brand new windowed part, stick it
into your programmer and read it into memory.  If you are using the PS+
under MPLAB, just open the calibration value window to see the value.  If
you are using a homebrew programmer, just read the chip: the calibration
value is encoded as a movlw XX at the highest program memory
location.  Just write the value somewhere on the chip.

Getting the value back into the chip after you have erased it is almost as
easy.  If you are using the PS+, just open the calibration window and type
it in.  Its a bit more difficult when using a homebrew programmer.  The
easiest way is to simply put the retlw XX in your source code, at the
highest program location.  For your 12c3519, you would do the following:

    org 0x3F
    retlw  XX  ;use the value you read from the chip when it was new

Note that you want to comment out the above once you move to OTP parts
since they already have the calibration constant at that location.

Making use of the calibration constant in your program is dead easy.  When
the chip comes out of reset, the calibration constant is automatically
placed in W.  All you have to do is move it to OSCCAL.

  org 0
  movwf  OSCCAL
;rest of your code goes here.

Hope this helps!

dwayne



Dwayne Reid   <EraseMEdwaynerspam_OUTspamTakeThisOuTplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\28@145137 by Drew Vassallo

picon face
>Making use of the calibration constant in your program is dead easy.  When
>the chip comes out of reset, the calibration constant is automatically
>placed in W.  All you have to do is move it to OSCCAL.

Is this true for the 12C67x as well?  The datasheet mentioned nothing of
"automatically loading W after reset".  I suppose it would be easy enough to
verify, although I don't actually have a chip to test with :)

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\29@125637 by Tony Nixon

flavicon
picon face
Drew Vassallo wrote:
>
> >Making use of the calibration constant in your program is dead easy.  When
> >the chip comes out of reset, the calibration constant is automatically
> >placed in W.  All you have to do is move it to OSCCAL.
>
> Is this true for the 12C67x as well?  The datasheet mentioned nothing of
> "automatically loading W after reset".  I suppose it would be easy enough to
> verify, although I don't actually have a chip to test with :)
>
> --Andrew

No, the 12C67x are 14 bit cores and have a RETLW 0xHH value at the last
ROM location.

To load the CAL value at any time just call the last ROM location and W
will hold the cal value on return.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamspam_OUTbubblesoftonline.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\29@125643 by Gennette, Bruce

flavicon
face
Most of these chips actually reset to the highest ROM location, execute the
movlw xx command found there and when the pcl rolls over to 0 you find that
"automatically loading W after reset" has happened.  You then choose to use
or ignore the value with your first program instruction.

If you have a blank 12C67x why don't you just read it to see if it has a
(factory installed!) movlw xx at the highest location?

Bye.

{Original Message removed}

2001\11\29@183049 by Lawrence Lile

flavicon
face
Speaking of 12CE5xx's,

I've been busting my head against the wall trying to read the EEPROM in a
12CE518.  There's good news and bad news:

Bad news:
Using CCS C, and CCS's supplied I2C routines, I never get any data when
trying to read EEPROM location 0x01.  WDT times out.

I then tried porting Microchip's appendix A (from the 12CE5xx databook)
I2C code
http://www.microchip.com/1000/suppdoc/appnote/firmware/183/index.htm

After porting this code to CCS C,  still could not read any data from EEPROM
(function always timed out the WDT before getting any data.  WDT set to max)

Good News:
So I went all the way back to the stone age (assembler) and was able to get
microchip's I2C code working.  That's good.  But assembler is just so
cumbersome.

Has anybody been successful at reading the I2C EEPROM in CCS C?  If so,
could I peek at your code?

-- Lawrence

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\29@201124 by Dale Botkin

flavicon
face
Lawrence,

It must just be a 12CE5XX thing, because I'm using CCS' I2C functions with
a 16F877/24LC256 with no problems.

So have you tried comparing what your working ASM code does to what CCS
comes up with from thr .LST file?  I've found that quite useful on several
occasions.

Dale
--
"Curiosity is the very basis of education and if you tell me that
curiosity killed the cat, I say only the cat died nobly."
         - Arnold Edinborough

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


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