floating point question on MSP430

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?

What is the FPP used for?

Thanks

David

Reply to
David R. McCoy
Loading thread data ...

package(FPP)?

formatting link
described in
formatting link

I'll

It is one way to do it.

Fiddles with floating point calculations (two formats provided). RTFM.

Cheers.

-- PabloBleyerKocik /"To the electron -- may it never pbleyer2004 / be of any use to anybody." @embedded.cl / -- JJ Thomson's favorite toast

Reply to
pablobleyer

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
Reply to
Spehro Pefhany

Otherwise google on "Newton's method" or "Newton-Raphson". What could Sir Isaac have achieved with a PC?

Cheers, Alf

Reply to
Unbeliever

All that time he wasted writing _Principia_ could have been better spent getting to the top level of Doom.

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
Reply to
Spehro Pefhany

There are several methods for calculating sq root. Search the archives here and software-eng. THe one the comes to mind is a sucessive approximation method that (from MSB to LSB) sets a bit in the answer then squares the number then tests is the guess squared is larger input value. I suspect the 430 will have fast multiply.

Floating point will be large code and time wise.

Good Luck George

Reply to
George

LOL!

--
Mike Page BEng(Hons) MIEE           www.eclectic-web.co.uk
Quiet! Tony's battling the forces of conservatism, whoever we are.
Reply to
Mike Page

Sir

A very big dent in his head instead of a bump.

Peter

Reply to
Peter Dickerson

package(FPP)?

formatting link

formatting link

I don't believe that the uC that I'm using has a hardware multiplier but I'll check. 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.

David

Reply to
David R. McCoy

I'll

reward"

measured

&

Fine if you have time to re-invent the wheel again.. if it's only of that period then use fp and get on with your application..!!

Reply to
TheDoc

it

You make a good point. Reinventing the wheel isn't something that I'm looking to do, it's just that I'm a bit unsure of how to use the floating point tool. A guy at my day job told me that floating point was only understood by the Aseembly Language Gurus. Now, I'm sure that I could eventually figure out how to use it; it's just that right now I'm weighing the amount of time it would take to come up to speed on FP versus writing code without it.

I'm using a MSP430F149 uC. The FP tool seems to be a header file that I add into my code but when I try to compile it, the compiler pukes and says that it doesn't recognize any of the commands in that file. What am I doing wrong?

Thanks

Reply to
David R. McCoy

package(FPP)?

Probably yes.

No.

For floating point arithmetics.

If all you need is an integer square root, going for FP is an overkill. There are several simple methods of computing integer (or fixed point) square root.

Reply to
Grzegorz Mazur

There's an exact square root procedure that can be used and is in Imagecraft's ICC430 package.

Reply to
Everett M. Greene

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.

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

Reply to
onestone

I'll

reward"

measured

it &

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 datasheet, 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 . . .

Reply to
David R. McCoy

I recall the tagline:

"How do you accelerate a Macintosh? 9.8 meters/second."

Reply to
Ben Bradley

"David R. McCoy" writes: [snip]

Have fun with the errors, omissions, and ambiguities of the documentation...

Reply to
Everett M. Greene

This could be a separate thread, as TI is far from the only manufacturer to have less-than-wonderful documentation. I seriously considered writing some sort of "Programming and Using The..." book on the Zilog Z89371 DSP when I was learning/using/designing it in. I got my ass bit a bunch of times (not just the docummentation, but various features that didn't work, assembler silently and happily generating bad object code from a bad instruction, etc), and it would have been an invaluable, time-saving guide for avoiding gotcha's for anyone who would want to use that chip. For good or bad, it looks like few people wanted to use it. The MSP430 appears to have growing popularity, and it seems a book on it, especially covering gotcha's and not just being a rehash of the TI docs, might actually sell enough copies to make it worthwhile.

Reply to
Ben Bradley

We could also get into a "discussion" of some manufacturers' not producing hardcopies of their docs anymore. We each get to produce our own at 10X the cost of the manufacturer doing it.

Reply to
Everett M. Greene

There is such a book already. I proofread it.

It's a good book.

Reply to
Lewin A.R.W. Edwards

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.