Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Weigh - Scale Firmware

2007-10-10 by kernels_nz

Hi Tom,

Im still having nightmares from my uni days when I tried to do some
32-bit multiplication and division on a AVR with the Codevision
compiler and completely gave up on it. Since then I have always tried
my best to avoid floating point and "long int" math on the AVR, but I
think in this case Ill have to try it again.

It's been quite a few years since then, so im sure the majority of
problems will have been solved. Will try it tonight and report back.

Cheers
Hein B
Auckland, New Zealand

--- In AVR-Chat@yahoogroups.com, Thomas Keller <tjkeller1@...> wrote:
>
>   Oh. come on.   Unless you're using an AVR that hasn't got sufficient 
> resources,
> doing fractional math is no problem. Any of the available C compilers 
> will do a
> fine job of floating point, or fixed point math for you.
> 
>   Indeed, I saw some assembly language fixed point7.8 mat routines that 
> would
> probably be more than serviceable for this application on
avrFreaks.org, 
> just
> yesterday.
> 
> tom
> 
> kernels_nz wrote:
> >
> > Hi Graham,
> >
> > Yeah, im thinking that thats probably the best way to go, I wasnt so
> > much worried about speed as that I dont yet have a lot of faith in the
> > compiler dealing with floating point numbers on the 8-bit processor. I
> > did get an excellent reply on the Atmel ARM forum from a guy that had
> > obviously done this before and he did provide me with what looks like
> > a good routine to do the scale calibration and weight calculation with
> > only integer math. Ill work through it tonight and report back
> > tomorrow if it works!
> >
> > Thanks for the reply!
> > Cheers
> > Hein B
> > Auckland, New Zeland
> >
> > --- In AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com>, 
> > "Graham Davies" <Yahoo37849@> wrote:
> > >
> > > --- In AVR-Chat@yahoogroups.com
<mailto:AVR-Chat%40yahoogroups.com>, 
> > "kernels_nz" <kernels@> wrote:
> > > >
> > > > ... low sample rates (10 s/s) ...
> > > > ... the bit thats got me a bit
> > > > worried is migrating the code
> > > > from the existing 32-bit processor
> > > > to a baby AVR.
> > >
> > > At such a low sample rate, why not stick with the floating
point? Or,
> > > at least run some kind of test to find out if it's possible.
> > >
> > > Graham.
> > >
> >
> >
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.