Hi all,

I'm struggeling for hours trying to find out why my program is working or not working depending on where I place the variables initialisation in my program. It's about to send an SMS and the destination mobile number is stored in an array of 12 elements.

After numerous tests, I found out that if I place my variables declaration at the beginning of my program (almost the top), the variables are wrongly initializied. If I put my variables far down in my code, juste before I have to use them, everything is working fine

I use a 18F1220 for the first time and chose this PIC because it was in my drawer and more precisely, because I can declare an array of 160 elements allowing me to store a full SMS in one single array.

But does this PIC has some particular specs that makes him tricky to me? Is there something I should learn about memory organisation?