Subject: Software Speed
From: Paul
Date: 2/20/2001, 11:22 AM


Ummm... I have extensive experience in programming microprocessors,
including several years as a systems programmer writing assembly
language for embedded micros.

IMHO, writing any significant amount of software in assembly language is
anachronistic. Processors nowadays are so fast and compilers so good
that it's just not necessary in most cases. Nowadays, the average C
programmer produces faster code than the average assembly language
programmer. And, of course, it's much less buggy and takes less time to
produce.

What's more, managing something real-time like engine throttles just
doesn't take much computer horsepower. Assuming an engine is running at
6,000RPM, a 16.77MHz processor could execute up to 2,800 instructions
for each *revolution*. I'd guess that that would be about enough power
to manage the throttle, so it could be adjusted every single revolution.

Frank.

Tracy Crook wrote:

With appologies in advance for the boring software jargon, I'll have to
disagree on this one, at least on the speed issue.  C would make debugging
faster and easier but my goal was to achieve 1/2 degree accuracy on ignition
timing.  Using your numbers (2800 instructions per rev at 6000 rpm) gives
less than 4 instruction periods to respond to an ignition timer event at
6000 rpm.   Engine controller code is inevitably interrupt driven.  No C
compiler I evaluated had a worst case interupt latency that would cut the
mustard, at least for the microcontrollers we have been talking about.  I
use the PIC17C756 running at 33 mhz in the EC2.  The Detroit automotive ECUs
have gone to state of the art 32 bit controllers running at fairly high
speeds in order to be fast enough to program in C.   It could be argued that
the interrupt code could be written in assembly (for speed) and the rest of
it handled in C but as noted previously, the interrupt code ends up being
most of the program, so I decided to do the exec in assembly as well.
Still, I'm looking forward to the time when these smaller controllers will
be fast enough for real time C.  It shouldn't be long.

Tracy Crook
tcrook@rotaryaviation.com
www.rotaryaviation.com

The AirCraft Rotary Engine NewsLetter.              Powered by Linux.

http://home.earthlink.net/~rotaryeng/            http://www.linux.org