Re: Floating point calculations on 16 uC
- From: paul$@pcserviceselectronics.co.uk (Paul Carpenter)
- Date: Sun, 28 Aug 2005 11:38:27 +0100 (BST)
On 28 Aug, in article
<1125220291.973553.315000@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
dbahlmann@xxxxxxxxx "db" wrote:
>Hi,
>
>I'm doing floating point calculations on a Fujitsu MB90F474 16bit uC.
>All float calculations are done in the main loop context. Sometimes the
>result returns a garbage value. This seems to happen only when
>interrupts are enabled. Note that there are no globals or shared data
>involved.
Look at your map file to see where the last local variables are before
the bottom of your stack. It sounds like the stack is overwriting the
variables as your stack is not large enough. If possible write some
known values after the last variables (like hex 01, 02, 03, 04, 05, 06...)
into the stack area. Then see what ones are still there when interupts
are enabled.
I suspect that local variables for your floating point routines are what
are being corrupted.
>If anyone has had similar problems please let me know. Any advice when
>using floating point calculations would be appreciated.
I don't think it is floating point related, but stack related due to too
small a stack size for your application.
--
Paul Carpenter | paul@xxxxxxxxxxxxxxxxxxxxxxxxxxx
<http://www.pcserviceselectronics.co.uk/> PC Services
<http://www.gnuh8.org.uk/> GNU H8 & mailing list info
<http://www.badweb.org.uk/> For those web sites you hate
.
- Follow-Ups:
- References:
- Floating point calculations on 16 uC
- From: db
- Floating point calculations on 16 uC
- Prev by Date: Floating point calculations on 16 uC
- Next by Date: Re: Normal 4-pin USB to USB-OTG?
- Previous by thread: Floating point calculations on 16 uC
- Next by thread: Re: Floating point calculations on 16 uC
- Index(es):
Relevant Pages
|