[Icc-mot] RE: Icc-mot Digest, Vol 41, Issue 2

Edward Karpicz ekarpicz at freemail.lt
Tue Jan 22 00:53:17 PST 2008


Rene,

I tried both, your get_pressure function (except aduconv is undefined) and 
your own fround. And these seem being working. Did you try to reproduce this 
problem in some simpler program? Maybe fround chokes on some special values? 
What arguments you are passing to fround?

You say it was OK using V6 to call fround from interrupt. Using FP from 
both, interrupts and main thread, or using preemptive RTOS and FP in 
different tasks, you had to save/restore FP context. Using V7 you don't have 
to save/restore FP context since V7 FP emulation doesn't use static 
variables and is reentrant.

I don't know if it matters but I see a type in your settings:

Program Memory: 0x4000.0x7FFF:**0xC00**.0xEFFF

Edward


----- Original Message ----- 
From: "Rene Streubel" <r.streubel at emtec-papertest.de>
To: <icc-mot at imagecraft.com>
Sent: Monday, January 21, 2008 3:52 PM
Subject: [Icc-mot] RE: Icc-mot Digest, Vol 41, Issue 2


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
**************************************



_______________________________________________
Icc-mot mailing list
Icc-mot at imagecraft.com
http://dragonsgate.net/mailman/listinfo/icc-mot




More information about the Icc-mot mailing list