High-resolution counters are used to generate a square wave, and the
duty cycle of the square wave is modulated to fire
the injectors.
The Stellaris ARM microcontroller contains one PWM module,
with four PWM generator blocks and a control block, for a total of 8 PWM
outputs.
The control block determines the polarity of the PWM signals, and
which signals are passed through to the pins. Each PWM generator block
produces two PWM signals that share the same timer and frequency and can
be programmed with independent actions.
The output signals, of the PWM generation blocks are managed by the
output control block before being passed to the
device pins as PWM0 and PWM1 or PWM2 and PWM3, and so on.
Each PWM generator block has the one 16-bit counter
Fortunately MikroPro has simplified this task for us and written some
BASIC routines that do the hard work. No need to do it in ASM.
Here they are. Still a lot of stuff. With this much stuff there are a
lot of opportunities for mistakes and bugs.
In the next installment we will show how a bit of cheap hardware can
greatly simplify the generations of variable pulse widths.
-------------------------------------------------------
Here it is. The CMOS 555 is a wonderful little cheap chip that is an
amazing linear pulse width generator. This circuit uses one 8 bit port
to set the digital pulse width and two control bits from another port.
They can be bit banding bits. One bit when set to high selects one of
the 555's and when set to low selects the other 555. If the trigger
comes from the crank angle sensor it is timed fuel injection. If the
trigger comes from a free running oscillator it is non timed fuel
injection. I suspect both the Megasquirt and Tracy's EFI systems are non
timed. With an engine running at 8000 RPM there is only 7.5 Ms per rev
and that is not a lot of time for timed fuel injection.
This gives a resolution of one part in 255. That should be enough for
fuel injection. That is less than .5%. 1/2 of one percent to be clear.
Not as good as a timer based PWM but adequate.
This trick will work on any processor. Not just the ARM.
Sometimes a hardware solution just works better than software where the
sales volume of the product is low and the cost of the product is not
critical.
BTW don't confuse the CMOS 555 with the analog 555. Apples and oranges.
With a different A to D chip (TLC 7226) this circuit can be easily
expanded to 4 PWM's.
Paul Lamar
The Rotary Engine News Letter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
You Tube
http://tinyurl.com/beqqxas
Copyright 1998-2013 All world wide rights reserved.