RAM values changes unexpectedly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RAM values changes unexpectedly

Jump to solution
1,620 Views
Jonathanp
Contributor I

Hi,

 

First of all excuse my low english level.  Something extrange happend to me....When I run the follow code (I'm using an AP16)

 

void CONVERT_DATA(void)
{
  TEMPORAL1=MSGRECEIVED[17];
  TEMPORAL1=TEMPORAL1-48;
  LATITUDE=TEMPORAL1*10;
  TEMPORAL1=MSGRECEIVED[18];
  TEMPORAL1=TEMPORAL1-48;
  LATITUDE=LATITUDE+TEMPORAL1;
 
  TEMPORAL1=MSGRECEIVED[19];
  TEMPORAL1=TEMPORAL1-48;
  MIN=TEMPORAL1*100000;
  TEMPORAL1=MSGRECEIVED[20];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*10000;
 
 
  TEMPORAL1=MSGRECEIVED[22];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*1000;
  TEMPORAL1=MSGRECEIVED[23];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*100;
  TEMPORAL1=MSGRECEIVED[24];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*10;
  TEMPORAL1=MSGRECEIVED[25];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1;
 
  MIN=MIN/600000;
  LATITUDE=LATITUDE+MIN;  
 
  TEMPORAL1=MSGRECEIVED[29];
  TEMPORAL1=TEMPORAL1-48;
  LONGITUDE=TEMPORAL1*100;
  TEMPORAL1=MSGRECEIVED[30];
  TEMPORAL1=TEMPORAL1-48;
  LONGITUDE=LONGITUDE+TEMPORAL1*10;
  TEMPORAL1=MSGRECEIVED[31];
  TEMPORAL1=TEMPORAL1-48;
  LONGITUDE=LONGITUDE+TEMPORAL1;
 
  TEMPORAL1=MSGRECEIVED[32];
  TEMPORAL1=TEMPORAL1-48;
  MIN=TEMPORAL1*100000;
  TEMPORAL1=MSGRECEIVED[33];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*10000;
 
 
  TEMPORAL1=MSGRECEIVED[35];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*1000;
  TEMPORAL1=MSGRECEIVED[36];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*100;
  TEMPORAL1=MSGRECEIVED[37];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1*10;
  TEMPORAL1=MSGRECEIVED[38];
  TEMPORAL1=TEMPORAL1-48;
  MIN=MIN+TEMPORAL1;
 
  MIN=MIN/600000;
  LONGITUDE=LONGITUDE+MIN;  
 
 
  TEMPORAL1=MSGRECEIVED[44];
  TEMPORAL1=TEMPORAL1-48;
  SATELITES=TEMPORAL1*10;
  TEMPORAL1=MSGRECEIVED[45];
  TEMPORAL1=TEMPORAL1-48;
  SATELITES=SATELITES+TEMPORAL1;                 
}

 

The values of MSGRECEIVED changes and I don't understand why it happen if I don't assing this array in this funtion I only read it. If you can help me I'll really apreciate it. 

 

Regards,

Jonathan

Message Edited by Jonathanp on 2009-04-16 04:44 AM
Labels (1)
0 Kudos
Reply
1 Solution
702 Views
Lundin
Senior Contributor IV
Variables changing unexpectedly is almost always caused by stack overflow. Try to make the stack larger and see if this solves the problem.

View solution in original post

0 Kudos
Reply
2 Replies
703 Views
Lundin
Senior Contributor IV
Variables changing unexpectedly is almost always caused by stack overflow. Try to make the stack larger and see if this solves the problem.

0 Kudos
Reply
702 Views
Jonathanp
Contributor I

Thankyou Lundin I made the stack larger and it solved the problem.

 

Jonathan

0 Kudos
Reply