CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

copy OSCCAL value ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
deepakomanna



Joined: 06 Mar 2007
Posts: 92
Location: Pune,India

View user's profile Send private message AIM Address Yahoo Messenger

copy OSCCAL value ?
PostPosted: Mon Aug 06, 2007 9:58 pm     Reply with quote

Dear Sir,
here i am using 12f629, MPLAB 7.5 Ver. & CCS PCM C Compiler, Version 3.249, 34534.

I want to copy OSCCAL Value from 0x03ff to OSCCAL reg.
plz tell me how can i do this ?
Also while programming the IC ,if i used erase option, it will erase OSCCAL value from 0x03ff location?
_________________
Thank You,
With Best Regards,
Deepak.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Aug 06, 2007 11:02 pm     Reply with quote

Quote:
I want to copy OSCCAL Value from 0x03ff to OSCCAL reg.

You have been on this forum long enough so that you should know how
to find this information.
1. Download the 12F675 data sheet and find the address of the OSCCAL
register. It's 0x90.

2. Make a small test program, like this:
Code:

#include <12F675.h>
#use delay(clock=4000000)
#fuses INTRC_IO, NOWDT, NOMCLR, PUT, BROWNOUT

void main()
{

while(1);
}


3. Compile the program with vs. 3.249 of the PCM compiler, and then
look at the .LST file. Here you can see what it does.
Code:

0000:  MOVLW  00
0001:  MOVWF  0A
0002:  GOTO   004
0003:  NOP
0004:  CALL   3FF   // Get the OSCCAL value in the W register.
0005:  BSF    03.5  // Bank 1
0006:  MOVWF  10    // Move W into the OSCCAL register at 0x90.
0007:  MOVLW  00
0008:  MOVWF  0A
0009:  GOTO   00A


Quote:
Also while programming the IC ,if i used erase option, it will erase OSCCAL value from 0x03ff location?

Read the ICD2 help file in MPLAB. Do a search for the word 'calibrate'.
Then you find this:
Quote:

Note: Internal oscillator and bandgap calibration bits are always
preserved by MPLAB ICD 2, for the erase cycle. Only during
programming may their values be changed

Most questions like this can be answered by looking at the MPLAB ICD2
help file.

With this help, next time you should be able to do these things.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group