Re: Floating point calculations on 16 uC
- From: R Adsett <radsett@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 13:57:10 -0400
In article <1125323242.505618.202750@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
cbarn24050@xxxxxxx says...
>
> 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.
> >
> > If anyone has had similar problems please let me know. Any advice when
> > using floating point calculations would be appreciated.
> >
> > Regards
> > Dieter
>
> You dont say what kind of garbage your getting. Stack overruns are easy
> to detect as it will trash your fixed variables starting from the
> highest 1 (check your map file). Sometimes you can have problems with
> far/near pointers. Compile useing the large model and see if your
> problem dissapears. If all else fails disable each interrupt
> individualy.
There is one rather ugly variant of stack overflow that I ran across many
moons ago (I've forgotten which compiler). That particular compiler used
space on the stack BEYOND the current stack pointer for floating point
storage, the net result of cource being that any interrupt was just about
assured of corrupting a floating point operation if it occurred during
the time that floating point calculation were down.
Thankfully I wasn't contemplating any floating point being used but
reading that ensured I din't even try.
Lesson learned, make sure you read your compiler manual. All of your
compiler manual.
If your compiler manual has a section of the floating point
implementation make sure you read it and understand what it's using for
storage. These sections often have notes on interactions with interrupts
and task switching.
Robert
.
- References:
- Floating point calculations on 16 uC
- From: db
- Re: Floating point calculations on 16 uC
- From: cbarn24050
- Floating point calculations on 16 uC
- Prev by Date: Re: Using AD7890
- Next by Date: Re: Using AD7890
- Previous by thread: Re: Floating point calculations on 16 uC
- Next by thread: Re: Floating point calculations on 16 uC
- Index(es):
Relevant Pages
|