PDA

View Full Version : FPU for pic



Art
- 11th May 2008, 08:23
Hi Guys,
I'm wondering if anyone has used any of the FPUs for microcontrollers out there with 8bit pics?
Any reccomendations?
Cheers, Art.

skimask
- 11th May 2008, 09:59
Don't have any recommendations for external FPU's...the Microchip math lib's are usually enough, and fast enough.

What functions in particular are you looking to use?

Acetronics2
- 11th May 2008, 10:12
Any reccomendations?

Cheers, Art.

Hi, Art

Yes ... one recommendation : check your problem twice to see if FPU compulsory ... and overall :

1) if precision required doesn't need some bits less ...

2) If sensor processing ... which is the sensor precision ...

In simple words, which is the LSB "real world" meaning.

Alain

Art
- 12th May 2008, 02:37
In particular, at the moment I want to do Sunrise, Sunset, Moonrise, Moonset and Moon phase calculations
which all require a good definition of Pi to as many decimal places as possible.

I've already ported this:
http://www.sci.fi/~benefon/rscalc.c
Sunrise/set times code to the Sony Playstaton Portable (still using C)
which is not that hard because the PSP has an FPU, and float variables.
Here is the Moonrie/Moonset/Moon phase calc working:
http://au.youtube.com/watch?v=Ye243VFShAs

That one was ported from Commodore 64 style BASIC which STILL use floats (as did the C64).

I've no idea how to reproduce the same programs with a pic and no FPU.
Also, I have similar ideas for GPS calculations where coordinates have many decimal places.
Cheers, Art.

tenaja
- 12th May 2008, 02:49
I would be surprised if M'chip didn't have FP subroutines in assembly on their site. A trial version of their c compiler might get it. I know for certain that the Proton+ Basic compiler has FP, and I believe they have a trial version of it, too.
http://www.picbasic.org/index.php

Acetronics2
- 12th May 2008, 09:18
Hi,

You ALSO can download the PbP Floating point routines ( adapted from µChip ones ) on melab's site ...

BUT remember PI can be closely approximated by the division of two integers ... what doesn't solve the trigonometric "genuine" functions lack of precision ... !!!

for coprocessor ...

http://www.micromegacorp.com/pbp.html

Alain

Art
- 12th May 2008, 11:51
Wow, didn't know Microchip had a C compiler. I'll have to check that out.
Will also look for the Pic BASIC routines.
Thanks :)