Hi everythere... I'm using a QY4 to make a voltage/current mesurement, all the code is compiled in codewarrior 6.3 and made in C. The problem is when I multiply and divide to get the result in a floating point variable to show it in a LCD the program stops in the library RTSHC08.C in the sub-rutine _FMUL_Common instruction JSR _UNPACK_k_to_K; and the compiler sends this error:
Error: Attempt to push or pop with SP out of allowed range
Any idea??
Sorry for my bad english. I read better than I write. jeje
Thanks
Damian
Solved! Go to Solution.
Hello Damian,
With the device you are using, I doubt that you will have sufficient resources for floating point calculations. With a RAM capacity of 128 bytes, you will likely not be able to make the stack sufficiently large. The 4K limit for flash memory might also be problematic for the floating point library functions.
These tiny devices were never intended to support floating point.
Depending on your application, it may be feasible to alternatively use integer calculations for your processing. Otherwise you will need to choose another MCU with considerably more RAM (and flash memory) resources. This should be from the MC9S08 family, rather than the now obsolete MC908 family.
Regards,
Mac
Hello Damian,
With the device you are using, I doubt that you will have sufficient resources for floating point calculations. With a RAM capacity of 128 bytes, you will likely not be able to make the stack sufficiently large. The 4K limit for flash memory might also be problematic for the floating point library functions.
These tiny devices were never intended to support floating point.
Depending on your application, it may be feasible to alternatively use integer calculations for your processing. Otherwise you will need to choose another MCU with considerably more RAM (and flash memory) resources. This should be from the MC9S08 family, rather than the now obsolete MC908 family.
Regards,
Mac
The flash memory and the ram memory is enough, and the calculations are not too large, I think I will try increase the stack size.
Thank you!
What is exact compiler message? Is this message really generated at compile time?
Did you try increasing stack size setting in PRM file?
is not a compiler message, it's a simulator message. I will try increase the stack size, I didn't know that I can that.
Thank you!