struct GPRS{
short Reset;
short StartSIM900;
char IP_Attemps;
short ComFromSMS;
short IDxError;
char SMS_Phone[15];
short ChkError;
short Responder;
short MassiveAnswer;
char Step;
short ShutGPRS;
char VectorTypeArray[7];
char VectorActual;
short AllVectorsInit;
char GPRS_Step;
char Pendientes;
short UnderBit;
}GPRS_Status;
The variable VectorTypeArray[7] is set to zero one by one every time that a CCP interrupt ends.
The compiler version is 5.025.
I'm using this variable only inside an interrupt routines
I think that can be a issue with the FSR register.
I wonder if there any way to make a breakpoint when a variable change to detect what line of code is messing with this variable. _________________ Electric Blue
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
Posted: Mon Jul 13, 2015 9:10 am
What processor?.
Generally, there is no simple debugging method to find this.
The compiler/chip does not support bit aligned variables. So you will be wasting bytes as the compiler has to use 2 bits for the first two shorts, then byte/word align (depending on the chip) for the characters.
Better to organise your data so things are easier to align:
Code:
struct GPRS{
char SMS_Phone[15];
char IP_Attemps;
char VectorTypeArray[7];
char GPRS_Step;
char Pendientes;
char VectorActual;
char Step;
short Reset;
short StartSIM900;
short ComFromSMS;
short IDxError;
short ChkError;
short Responder;
short MassiveAnswer;
short ShutGPRS;
short AllVectorsInit;
short UnderBit;
}GPRS_Status;
E_Blue
Joined: 13 Apr 2011 Posts: 417
Posted: Mon Jul 13, 2015 9:31 am
The processor is PIC18F67j50.
Thanks for the tip; I tried and get this results.
Before the change
ROM used 37702 RAM used 2614
After the change(reorder shorts)
ROM used 37792 RAM used 2608.
I don't get why use more ROM, I did not change the code. _________________ Electric Blue
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