Don't touch that last location! What is there is a movlw instruction along with the factory calibrated oscal value. When the chip is powered up it resets at the top of memory, does the mov to load the value into w and then the program counter rolls over to 0. If you want to use the calibration then your first command (at org 0) will be movf oscal. Lots of programers will clear memory before writing a chip, or write nop to ALL 'unused' program ROM, so it is good (safe) practice to read the chip, and manually write the movlw xx back to the correct location when programing it. Bye. -----Original Message----- From: Drew Vassallo [mailto:snurple@HOTMAIL.COM] Sent: Monday, 19 November 2001 14:02 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: OSCCAL for 12C671 I haven't used this chip yet, but I am planning on using it for an upcoming project. I notice that in the datasheet there is a section that explains the INTRC feature. From what I can gather, I am supposed to issue a CALL to the last program memory location (0x3FF) in order to retrieve the predetermined calibration value, then load this into the OSCCAL register. Do I have to do this right at the start of the program as an initialization? Or is the "nominal" 4 MHz frequency ordinarily acceptable? I'm planning on doing bit-banged I2C comms. The datasheet also states that before erasing the chip, this value should be "saved". My question is: how do I know what this value is, and how do I "save" it? Thanks, --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 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads