which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

672 Views
caroltrudel
Contributor I

Which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to work.

Labels (1)
0 Kudos
4 Replies

517 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Carol,

all  default CW for HCs08 libraries use 16bit int for integer type. long type is 32bit.

if you use floating support, we have two options when creating a new project:

pastedImage_0.png

user can modify type size in compiler settings:

pastedImage_1.png

can this help you?


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

517 Views
caroltrudel
Contributor I

Hello Jennie,

I think I have resolved my issue. An additional typecast was needed before the “Temp_Code” variable which needs to be referenced as ((signed long) Temp_Code) in all calculations.

Thanks,

Carol

De : Carol Trudel

Envoyé : 17 février 2016 08:22

À : 'jive-571985846-5ter-2-d6ra@mail.freescale.jiveon.com'

Objet : RE: - which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

Hello Jennie,

I’m fine with int and long definitions in your mail. However I cannot make the following to work.

int Temp_Code;

signed long temperature;

temperature = (signed long )(Temp_Code*17572);

Expression “Temp_Code*17572” evaluates correctly in debugger but when I write the result in 32-bit variable “temperature”, I lose the upper 16 bits which remain 0. My guess was that maybe I need to use a different library to handle this.

How can I make this calculation work ?

Thanks,

Carol

De : ZhangJennie

Envoyé : 17 février 2016 00:59

À : Carol Trudel

Objet : Re: - which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

NXP Community <https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

reply from ZhangJennie<https://community.freescale.com/people/ZhangJennie?et=watches.email.thread> in CodeWarrior for MCU - View the full discussion<https://community.freescale.com/message/615286?et=watches.email.thread#615286>

0 Kudos

517 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hi,

I just tested your code from my side , seems it works normal. see attached video and demo code.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

517 Views
caroltrudel
Contributor I

Hello Jennie,

I’m fine with int and long definitions in your mail. However I cannot make the following to work.

int Temp_Code;

signed long temperature;

temperature = (signed long )(Temp_Code*17572);

Expression “Temp_Code*17572” evaluates correctly in debugger but when I write the result in 32-bit variable “temperature”, I lose the upper 16 bits which remain 0. My guess was that maybe I need to use a different library to handle this.

How can I make this calculation work ?

Thanks,

Carol

De : ZhangJennie

Envoyé : 17 février 2016 00:59

À : Carol Trudel

Objet : Re: - which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

NXP Community <https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

which library should I ise for 32-bit support in CW 10.6 for the MC9S08SH32 MCU ? Standard "ansis.lib" doesn't seem to provide support.

reply from ZhangJennie<https://community.freescale.com/people/ZhangJennie?et=watches.email.thread> in CodeWarrior for MCU - View the full discussion<https://community.freescale.com/message/615286?et=watches.email.thread#615286>

0 Kudos