16.16 signed binary math lib for small RAM-less AVR's

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Need to do some math in your small RAM-less AVR, for example the ATiny's ?

Can also be used in all other AVR's

- Number range is from -32767 to 32768 with a 16 bit fractional part, that is a 0.000015258 resolution

- The multiply and divide has overflow flag and divide with zero flag.

- The results is rounded to nearest LSB.

- Multiply does a full 16.16 to 32.32 before rounding off to 16.16

- Code size: 402 bytes.

- Unused functions can be removed for a smaller codesize

See my project:
http://www.avrfreaks.net/index.p...

Feedback is welcome :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No opinions? :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll need to take a look at this... i have some division that needs fractions but _really_ doesn't need super resolution. :)

Anders

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...and why is this post here?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unknown, but I can promise that this post will be useless:

js! My Dad was born in Sydney. :D I've only been down there once, but even though I was born in Sweden, I still have my Australian citizenship. He tells me the story about one time when he was in University he climbed up to the top of the harbor bridge arch and hung a giant "For Sale" sign on it. :D Back then there were no gates or fences.

Anders

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
...he climbed up to the top of the harbor bridge arch and hung a giant "For Sale" sign on it.

What price did the bridge go for finally? ;-)

Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

..we are still paying for it.. :evil:

Anyway this forum is for finished projects rather than posting questions, so it may be wise to post in the main AVR forum if one would like replies. :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John,

It's an old thread, and is a project. OP asks for feedback. That's all.
Therefor I see no reason to move it.

Nard

A GIF is worth a thousend words   She is called Rosa, lives at Mint17.3 https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips