Exact match. Not showing close matches.
PICList
Thread
'[PIC] Math, math, and more math...'
2006\05\04@155910
by
PicDude
I'm getting ready to modify an app with a bunch of math (+, , *, / only), but
I want to calculate to 2 (or perhaps even 3) decimal places. The app is
currently written in assembly using integer math, but I'm not looking forward
to doing all the math in assembly.
Is there a way to write the math parts in Basic or C, compile those parts to
assembly and integrate that into my code? Alternatively, are there
assemblylanguage math libraries available anywhere that can make this
easier? Performance/efficiency is not critical, since the chip (16F913) is
currently running at ~2Mhz, and I can step that up if necessary.
Cheers,
Neil.
2006\05\04@161352
by
JanErik Soderholm
PicDude wrote :
> I'm getting ready to modify an app with a bunch of math (+,
> , *, / only), but I want to calculate to 2 (or perhaps even 3)
> decimal places.
The number of decimals is rather irrelevant,
what is the total dynamic range ?
0.010  0.001 ?? (only 10 distinct values...)
or
10000.000  0.001 (a little more work...)
or (probably) something else ?
Regards,
JanErik.
2006\05\04@162751
by
Charles Craft
Bolt this to the top of your 16F913:
http://www.micromegacorp.com/umfpuv2.html
The uMFPU V2 floating point coprocessor is easily interfaced with virtually any microcontroller to provide support for 32bit IEEE 754 compatible floating point and 32bit long integer calculations. It can be connected using either an I2C or SPI compatible interface. The uMFPU uses an internal oscillator and requires no external components. It is available in an 8pin DIP or SSOP20 SMT package. Documentation and support software is available for a variety of microcontrollers (see list on the left).
{Original Message removed}
2006\05\04@163821
by
PicDude
On Thursday 04 May 2006 15:13, JanErik Soderholm wrote:
> The number of decimals is rather irrelevant,
> what is the total dynamic range ?
>
> 0.010  0.001 ?? (only 10 distinct values...)
>
> or
>
> 10000.000  0.001 (a little more work...)
>
> or (probably) something else ?
The range of values is about 300.00 to 300.00. With 2 decimal places, that's
60,000 possible values. BUT, I have not yet determined how many extra places
I will need for the intermediate calcs. I'll mostly be deriving the gradient
and constant for a straightline equation ( y=mx+c ) then solving for it
given values of x. Also, there is some IIR filtering in there. I'm guessing
the m will have to be 3 decimal places else I'll lose accuracy.
The previous version is only solving the equation and the range of values is
0100, with integer math. Internally, I'm calculate to 4 *binary* places.
Cheers,
Neil.
2006\05\04@164745
by
Larry G. Nelson Sr.

I have had good luck with the math routines in the Microchip ap notes on several projects. I have had people tell me they are broken but they have passed all the tests I have run and they are in several commercial producrts working fine.
Larry
 PicDude <spam_OUTpicdudeTakeThisOuTnarwani.net> wrote:
{Quote hidden}> I'm getting ready to modify an app with a bunch of math (+, , *, / only), but
> I want to calculate to 2 (or perhaps even 3) decimal places. The app is
> currently written in assembly using integer math, but I'm not looking forward
> to doing all the math in assembly.
>
> Is there a way to write the math parts in Basic or C, compile those parts to
> assembly and integrate that into my code? Alternatively, are there
> assemblylanguage math libraries available anywhere that can make this
> easier? Performance/efficiency is not critical, since the chip (16F913) is
> currently running at ~2Mhz, and I can step that up if necessary.
>
> Cheers,
> Neil.
> 
2006\05\04@164836
by
James Newton, Host
2006\05\04@164951
by
PicDude
This is actually pretty neat. Unfortunately in this app, I'm converting an
existing design and space is ultra mega uber tight. I have the option of
using any 28SSOP PIC that is pincompatible with the 16F913, but can't add
any other chips.
Cheers,
Neil.
On Thursday 04 May 2006 15:27, Charles Craft wrote:
{Quote hidden}> Bolt this to the top of your 16F913:
>
>
http://www.micromegacorp.com/umfpuv2.html
>
> The uMFPU V2 floating point coprocessor is easily interfaced with
> virtually any microcontroller to provide support for 32bit IEEE 754
> compatible floating point and 32bit long integer calculations. It can be
> connected using either an I2C or SPI compatible interface. The uMFPU uses
> an internal oscillator and requires no external components. It is available
> in an 8pin DIP or SSOP20 SMT package. Documentation and support software
> is available for a variety of microcontrollers (see list on the left).
2006\05\04@170121
by
olin piclist
PicDude wrote:
> The range of values is about 300.00 to 300.00. With 2 decimal
> places, that's 60,000 possible values. BUT, I have not yet
> determined how many extra places I will need for the intermediate
> calcs. I'll mostly be deriving the gradient and constant for a
> straightline equation ( y=mx+c ) then solving for it given values of
> x. Also, there is some IIR filtering in there. I'm guessing the m
> will have to be 3 decimal places else I'll lose accuracy.
We've got 32 bit fixed point and 24 bit floating point routines for the PIC
16, although they expect our PIC development environment and would need some
modification to work outside them.
******************************************************************
Embed Inc, Littleton Massachusetts, (978) 7429014. #1 PIC
consultant in 2004 program year. http://www.embedinc.com/products
2006\05\04@182245
by
PicDude
I've used some of those before, but I was thinking this would have to be
floating point. But more and more I guess I'm going back to doing this as
integers, so I may end up there or with Microchip's routines.
Cheers,
Neil.
On Thursday 04 May 2006 15:48, James Newton, Host wrote:
> > Alternatively, are there assemblylanguage math libraries
> > available anywhere that can make this easier?
>
> http://www.piclist.com/techref/microchip/math/basic.htm
>
> 
> James.
2006\05\04@183426
by
James Newtons Massmind
www.piclist.com/techref/microchip/math/fp.htm

James.
{Quote hidden}> Original Message
> From:
.....piclistbouncesKILLspam@spam@mit.edu
> [
piclistbouncesKILLspammit.edu] On Behalf Of PicDude
> Sent: 2006 May 04, Thu 16:22
> To:
.....piclistKILLspam.....mit.edu
> Subject: Re: [PIC] Math, math, and more math...
> Importance: Low
>
> I've used some of those before, but I was thinking this would
> have to be floating point. But more and more I guess I'm
> going back to doing this as integers, so I may end up there
> or with Microchip's routines.
>
> Cheers,
> Neil.
>
>
> On Thursday 04 May 2006 15:48, James Newton, Host wrote:
> > > Alternatively, are there assemblylanguage math libraries
> available
> > > anywhere that can make this easier?
> >
> > www.piclist.com/techref/microchip/math/basic.htm
> >
> > 
> > James.
> 
More... (looser matching)
 Last day of these posts
 In 2006
, 2007 only
 Today
 New search...