Creating a pulse for injector drivers
Darrell Norquay
dnorquay at iul-ccs.com
Fri Jan 17 06:17:50 GMT 1997
S. Lastuka wrote:
> >>An output compare can be
> >>used to turn off a pulse after a certain time, but how to you turn the
> >>pulse on in the first place? Please help.
Use an interrupt service routine to run the injectors, triggered off either
a hardware input (crank posn or ignition signal) or just asynchronously off
the RTC interrupt. First thing to do in the ISR is read the timer counter
register. Then set the injector driver output "on". Add the required time
(value from pulse width fuel map) to the TCR, and store it at the OCR for
the timer that you are using, then enable it's output compare interrupt.
Set up the OCR interrupt routine to turn the injector output off, and then
disable itself, so it won't trigger again until the next hardware interrupt
(this is called a self extinguishing timer interrupt). You can use the
relevant timer OC output pin for the injector control, or just use any other
port bit with a BSET and BCLR instruction.
Main code routine does all the calculations, measurements, and housekeeping
functions at full processor speed, and calculates a vector into the fuel map
based on inputs. It only gets interrupted occasionally to service the
injectors.
If you're using the synchronous (hardware triggered) method, you could also
add an additional timer in the chain in the same manner to delay the
injector on routine for some time after the hardware trigger. In this
manner you can time the injector opening to any point during an engine cycle.
regards
dn
dnorquay at iul-ccs.com
More information about the Diy_efi
mailing list