floating point in HC908QY4

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

floating point in HC908QY4

ソリューションへジャンプ
1,054件の閲覧回数
damiandesiderio
Contributor I

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

 

ラベル(1)
タグ(4)
0 件の賞賛
返信
1 解決策
844件の閲覧回数
bigmac
Specialist III

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

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
845件の閲覧回数
bigmac
Specialist III

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

0 件の賞賛
返信
844件の閲覧回数
damiandesiderio
Contributor I

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!

0 件の賞賛
返信
844件の閲覧回数
kef
Specialist I

What is exact compiler message? Is this message really generated at compile time?

Did you try increasing stack size setting in PRM file?

844件の閲覧回数
damiandesiderio
Contributor I

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!

0 件の賞賛
返信