[Icc-mot] RE: Icc-mot Digest, Vol 41, Issue 2
Rene Streubel
r.streubel at emtec-papertest.de
Mon Jan 21 05:52:13 PST 2008
Problem with fround and/or fp conversion in ICC12 V7.03B
Hello!
I converted a project from ICC V6 to V7 and have now the following problems.
I use a HCS12DP512. In V6 all works well.
Now the programm crashes (hang up) during the use of the "fround" function. for example:
#define p_runden 16
#define psi_to_mbar 68.948
#define ad_lsb 4.8828125
signed int get_pressure(unsigned char p_ch)
{
unsigned int i,i_temp;
i_temp=0;
for (i=0 ;i<p_runden ;i++)
{
i_temp+=aduconv(p_ch);
}
return fround(psi_to_mbar*15.0*((ad_lsb*(double)i_temp/p_runden)-500.0)/4000.0);
}
If i dont use fround in the last line, the program works well, but if i use fround, it crashes.
[return (psi_to_mbar*15.0*((ad_lsb*(double)i_temp/p_runden)-500.0)/4000.0);]
In V6 it works.
This function also is called from the "TimerOverflowInterrupt" If i call the function outside the interrupt it works well. But in V6 it also worked in the TOF.
What is new in the V7 "fround" function? Takes it more time then in V6? What can i do? I have also problems in other routines, if i use the fround-function.
My target device settings are:
Program Memory: 0x4000.0x7FFF:0xC00.0xEFFF
Data Memory: 0x800.0x3600
Stack Pointer: 0x3E00
ExpandedMemory enabled Addr: 0x80000.0xFEFFF
Make Paged Functions Default is enabled
Linear S2 Record Type
CPU Type HCS12
Printf Version: float
____________________________________________________________________________
I try my own fround function and found another problem:
This function did not work: The program crashes and is hang up!
signed long fround(float data_in)
{
signed long data_out;
if (data_in>0)
{
data_out=(signed long)(data_in+0.5);
}
return data_out;
}
Without the "if" statement it works well and does not crash!
signed long fround(float data_in)
{
signed long data_out;
{
data_out=(signed long)(data_in+0.5);
}
return data_out;
}
Please help,
Otherwise I cant use the new ICC12V7.
Regards
Rene
--------------------------------------------------
René Streubel
Research & Development Emtec Electronic GmbH / Germany
E-mail: r.streubel at emtec-papertest.de
-----Original Message-----
From: icc-mot-bounces at imagecraft.com [mailto:icc-mot-bounces at imagecraft.com] On Behalf Of icc-mot-request at imagecraft.com
Sent: Wednesday, January 16, 2008 10:01 PM
To: icc-mot at imagecraft.com
Subject: Icc-mot Digest, Vol 41, Issue 2
Send Icc-mot mailing list submissions to
icc-mot at imagecraft.com
To subscribe or unsubscribe via the World Wide Web, visit
http://dragonsgate.net/mailman/listinfo/icc-mot
or, via email, send a message with subject or body 'help' to
icc-mot-request at imagecraft.com
You can reach the person managing the list at
icc-mot-owner at imagecraft.com
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Icc-mot digest..."
Today's Topics:
1. ICC12 7.03B BETA0 (Richard Man)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Jan 2008 18:59:02 -0800
From: Richard Man <richard at imagecraft.com>
Subject: [Icc-mot] ICC12 7.03B BETA0
To: icc-mot at imagecraft.com
Message-ID: <200801160313.m0G3DxVQ055832 at dragonsgate2.imagecraft.com>
Content-Type: text/plain; charset="us-ascii"; format=flowed
Just a minor update to fix missing unsigned to FP conversion code:
http://www.imagecraft.com/pub/iccv712_v703b_beta0.exe
V7.03B - Jan 20th, 2008
Compiler
- 7.03A did not generate calls to "uint2fp" for unsigned to FP
conversion
Header Files
- the DP512 header file was incorrect.
// richard <http://www.imagecraft.com/>
<http://www.dragonsgate.net/mailman/listinfo> On-line orders,
support, and listservers available on web site.
[ For technical support on ImageCraft products, please include all
previous replies in your msgs. ]
------------------------------
_______________________________________________
Icc-mot mailing list
Icc-mot at imagecraft.com
http://dragonsgate.net/mailman/listinfo/icc-mot
End of Icc-mot Digest, Vol 41, Issue 2
**************************************
More information about the Icc-mot
mailing list