Author Topic: pic12f675 Calibration Data Question  (Read 3002 times)

0 Members and 1 Guest are viewing this topic.

Offline wheelyneilTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 1
  • FOR GET ABOUT IT
pic12f675 Calibration Data Question
« on: February 22, 2010, 11:53:08 PM »
Hello Forum

I am just starting to learn and have a simple question about reading the Calibration Data on 3 new 12f675's and wanting to make sure I have the info before starting to try and program with the Pickit2.

Well I have been doing some reading and looking at the structure of the 675's If I understand correctly as this statement from the Data sheet Say's

Quote
A calibration instruction is programmed into the last
location of program memory. This instruction is a
RETLW XX, where the literal is the calibration value.
The literal is placed in the OSCCAL register to set the
calibration of the internal oscillator.

When I use the pickit2 to read the program memories it returns on 2 of the chips on last address RETLW 0x34 and on the other one it is RETLW 0x2c. Then I went to the special function Register OSCCAL address 90 but the hex is 0x00.

Is this what I should be seeing when I have the pickit2 read the memories? ???


Just trying to figure things out a step at time . BABY STEPS THAT IS!
Take care
Neil

Offline hopslink

  • Robot Overlord
  • ****
  • Posts: 202
  • Helpful? 14
Re: pic12f675 Calibration Data Question
« Reply #1 on: February 23, 2010, 02:50:25 AM »
Hi Neil,

That is what you should see. As part of your initial setup routine you read the calibration data and copy it to OSCCAL (if using the internal oscillator). There is an assembly example to do that in the data sheet. See below for the critical commands with comments.
Code: [Select]
call  3FFh          ;Run the command at address 3FFh
movwf  OSCCAL      ;move the value in the working register to OSCCAL

@3FFH                 
retlw Cal_Val        ;Return to calling point, with the calibration value in the working (W) register

All the best with the project!

Paul 

Offline wheelyneilTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 1
  • FOR GET ABOUT IT
Re: pic12f675 Calibration Data Question
« Reply #2 on: February 23, 2010, 08:19:10 AM »
Thanks for the info Paul ;)
 I will try doing this today!
Take care
Neil