Re: Floating point operation in 8bit uCon
From: Ken Smith (kensmith_at_green.rahul.net)
Date: 08/13/04
- Next message: Product developer: "Re: Fifty-six Deceits in Fahrenheit 911"
- Previous message: Chaos Master: "Re: Throw away your network analyser and use Spice!"
- In reply to: Pooh Bear: "Re: Floating point operation in 8bit uCon"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 04:41:28 +0000 (UTC)
In article <411C3F81.47B03BF1@hotmail.com>,
Pooh Bear <rabbitsfriendsandrelations@hotmail.com> wrote:
[...]
>8051/2s are optimed for real time control not mathematics ! Even 16 bit
>math on them slows things down considerably.
I disagree.
The 8051 can address DATA memory with both R0 and R1. This is just about
right for doing multibyte operations on an 8 bit micro. The PIC is more a
case of optimized for control. It only has one indirect address but
allows single operations to do some of the things that take 2 or 3 on the
8051. If you are doing a "check this bit and that byte then decide the
port should go low" sort of thing, the PIC is more optimized for your
task.
>Having said that, many math issues can be simplified using look-up tables
>which are very fast in comparison.
In a lot of cases, you don't have to do the math at all. Now thats fast!
A classic sort of example is making a servo controller in a micro. It is
often enough to do something like this:
jb TooHigh,IsTooHigh ; Jump if the results are too high
jnb WasHigh,SkipInc ; Jump if the prev. was too
inc Control ; Add one to control twice
SkipInc: ; .. or
inc Control ; .. once depending
clr WasHigh ; remember what happened
ret ; done
IsTooHigh:
dec Control ; Subtract one from control
setb WasHigh ; Remember
ret ; Done
The result is a PI control like small signal responce and a slow slew
rate. It is often good enough.
-- -- kensmith@rahul.net forging knowledge
- Next message: Product developer: "Re: Fifty-six Deceits in Fahrenheit 911"
- Previous message: Chaos Master: "Re: Throw away your network analyser and use Spice!"
- In reply to: Pooh Bear: "Re: Floating point operation in 8bit uCon"
- Messages sorted by: [ date ] [ thread ]