Hello,
During debug, after you have entered the function and the function parameters are on the stack, ascertain the current address of the stack pointer. If this is less than the lowest allocated address for the stack (0x0167 from the map file), it is possible that you have overwritten some of the global or static variables.
Even if the pointer is slightly above the lowest address, this could still be problematic should an interrupt occur whilst within the function.
If the variable Temperatura is global, it may even be possible that this becomes overwritten by the stack during execution of a completely different part of the program.
Does your program use any float variables? If so, this will greatly increase the stack size requirement.
Regards,
Mac
Message Edited by bigmac on 2009-05-27 03:35 PM