Re: floating point question on MSP430

From: David R. McCoy (laserprojector2003_at_yahoo.com)
Date: 07/13/04


Date: Tue, 13 Jul 2004 21:27:28 GMT


"onestone" <onestoneXYZ@ABCbigpond.net.au> wrote in message
news:%YUIc.93023$sj4.19808@news-server.bigpond.net.au...
> David R. McCoy wrote:
>
> > "Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message
> > news:gft4f0puqf9ckmurmr66nv0mn5s2f5tjvb@4ax.com...
> >
> >>On Mon, 12 Jul 2004 02:57:49 GMT, the renowned "David R. McCoy"
> >><laserprojector2003@yahoo.com> wrote:
> >>
> >>
> >>>Hi All,
> >>>
> >>>What is TI talking about when they refer to the floating point
> >
> > package(FPP)?
> >
> >>>Is is able to be used on any of their uC?
> >>>
> >>>I need the uC to take the square root of a number and it seems that
I'll
> >>>have to use the FPP to do it. Is that true?
> >>
> >>Certainly not. But doing it that way might avoid having to write any
> >>code. If that's the only reason you need to include floating point
> >>math it will likely be quite inefficient wrt code size and speed.
> >>
> >>If the MSP430 you are using has a hardware multiplier- you can simply
> >>flip bits from the MSB down to the LSB, test (by squaring the number),
> >>correct and move down to the next bit till you get to the LSB- and it
> >>will be pretty fast and compact.
> >>
> >>Best regards,
> >>Spehro Pefhany
> >>--
> >>"it's the network..." "The Journey is the
reward"
> >>speff@interlog.com Info for manufacturers:
> >
> > http://www.trexon.com
> >
> >>Embedded software/hardware/analog Info for designers:
> >
> > http://www.speff.com
> >
> >
> > I don't believe that the uC that I'm using has a hardware multiplier but
> > I'll check.
>
> This suggests that you're in trouble anyway, since you don't know what
> features your target micro has. The F149 you are using has a hardware
> multiplier, but if I were you I'd use the floating point packet rather
> than try and write your own routine.
>
> > The calculation that I need to perform will only need to
> > perform 1 square root per event. The period between each event is
measured
> > in tens of seconds. Writing a routine that sets a bit and then squares
it &
> > tests sounds like it might be the way to go.
> >
> > thanks for everyones response.
>
> In a later post you state that you are using a compiler. Thus C. Most of
> the current C compilers have floating point procedures anyway. Probably
> even a sqr() function if not you need to do more than just include the
> header file, you must also include the *.lib file or source file that
> includes the actual functions.
>
> Al
>

Hi Al,

Ok. I can see that I'm stumbling on words now. I said "compiler" but I
meant "assembler". Sorry for the mixup. My C code abilities are very
limited. I'm trying to do this in Assembly since I'm more familiar with
that than C.

I also checked and yes, the F149 does have the hardware multiplier. I'm
learning alot about this uC. As many times as I've looked at the data***,
there are still things that I'm missing. Thanks.

I'll look into the FPP a bit closer and also evaluate some of the other
suggestions made here.

Thank you for your help. I may be back . . .


Quantcast