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