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 support@ccsinfo.com

Calibration message....

 
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

Calibration message....
PostPosted: Mon Apr 23, 2007 12:30 am     Reply with quote

Dear sir,
here i am using 12f629, MPLAB 7.5 Ver. & CCS PCM C Compiler, Version 3.249, 34534.
My query is, while i am programming one message box is appering
"Calibration Memory is Already Programmed"
but in my coding i declared,


[/code]
#use delay(clock = 4000000)
#byte OSCCAL = 0x90
void main()
{
...
...
#asm
CALL 0X03FF
MOVWF OSCCAL
#endasm
...
....
}
So plz tell me why it is showing this msg & this will affect in prog.
_________________
Thank You,
With Best Regards,
Deepak.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 23, 2007 12:45 am     Reply with quote

You probably have a #Rom statement in your program (not shown in your
post) that sets the OSCCAL value (at address 0x3FF) to some value.

MPLAB is informing you that it's not going to let you change the OSCCAL
value.
deepakomanna



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

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

calibration msg....
PostPosted: Mon Apr 23, 2007 1:53 am     Reply with quote

Thanks for replying,
But in my code i didn't not used #ROM like statement,
plz refer following code..
Code:

#include<12f629.h>
#fuses INTRC_IO,NOWDT,PUT,NOMCLR,PROTECT,NOCPD,BROWNOUT
#use delay(clock = 4000000)
#byte OSCCAL = 0x90

void init_CPU();

void DLY_CNT_FUNCTION();

void ON();

unsigned int16 RPM_COUNT;

int1 flag;

void main()
{
flag = 0;

RPM_COUNT = 0;
init_CPU();

while(1)
   {
      while(INPUT(PIN_A1));         //   Wait for Zero Pulse
         SETUP_TIMER_1(T1_DISABLED);      // TIMER_1 count OFF
         RPM_COUNT = GET_TIMER1();
         SET_TIMER1(0x00);
         SETUP_TIMER_1(T1_INTERNAL | T1_DIV_BY_8);      //TIMER 1 ON.
         if(flag == 1)   
                {                           
                ON();
               }
              
      while(INPUT(PIN_A0));      
      
         if(flag == 0)          
            {
               ON();
            }
      
   
          DLY_CNT_FUNCTION();
         
   }


}

void DLY_CNT_FUNCTION()
{

flag = 1;
if((RPM_COUNT >= 4167)||(RPM_COUNT == 0) )      /*rpm < 1800*/
      {
         flag = 0;               
         
      }
}
   

   
void ON()
{

/*=========== Turn ON FOR 60 usec =================   */   
OUTPUT_HIGH(PIN_A2);      
DELAY_US(60);            
OUTPUT_LOW(PIN_A2);      
/*=======================================================*/
}

void  init_CPU()
{
   PORT_A_PULLUPS(0x13);         // Enable pullups GPIO0,GPIO1,GPIO4 I/P &ALL O/P
   SET_TRIS_A(0x13);            //GPIO0,GPIO1 I/P & ALL O/P.
   SETUP_COMPARATOR(NC_NC_NC_NC);      // Make comparator off

   #asm
   CALL 0X03FF
   MOVWF OSCCAL
   #endasm

}

_________________
Thank You,
With Best Regards,
Deepak.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 23, 2007 2:11 am     Reply with quote

You don't need the #asm code to set the OSCCAL register. CCS does
it for you. Here is the code created by vs. 3.249 for your program:
Code:

0000 3000       00001 MOVLW  00
0001 008A       00002 MOVWF  0A
0002 2804       00003 GOTO   004
0003 0000       00004 NOP
0004 23FF       00005 CALL   3FF    // Get OSCCAL value in W
0005 1683       00006 BSF    03.5   // Bank 1
0006 0090       00007 MOVWF  10     // Register 0x90 = W
0007 3000       00008 MOVLW  00
0008 008A       00009 MOVWF  0A
0009 2843       00010 GOTO   043

This is put in by the compiler. It's not your #asm code.
deepakomanna



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

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

calibration msg...
PostPosted: Wed Apr 25, 2007 5:29 am     Reply with quote

Dear Sir,
Still it has problem.
I commented these lines which are used for OCCILLATOR CALIBRATION. in my code.
but still it is showing the message.

//#use delay(clock = 4000000)
//#byte OSCCAL = 0x90


// #asm
// CALL 0X03FF
// MOVWF OSCCAL
// #endasm
_________________
Thank You,
With Best Regards,
Deepak.
_________________
Thank You,
With Best Regards,
Deepak.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 25, 2007 1:15 pm     Reply with quote

My suggestion is to ask this question in the Microchip forum. That's
because the error message is coming from MPLAB and the programmer.
Ask them why it's giving the message.

Here is the ICD2 forum:
http://forum.microchip.com/tt.aspx?forumid=49

Here is the PicStart-Plus forum:
http://forum.microchip.com/tt.aspx?forumid=15
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