@me n mac: Uno with ATmega328. Thanks again for the insight. I was not aware that a timer could be variably subdivided.
Thanks for all the input everyone, Gives me a lot to consider. In the last 24 hours I have found other projects like mine, but very little code, and few going the route I intend.
What I’m trying to do is build a brute force, simple TBI conversion for my Chevy LUV and my cousin’s Toyota. Both are 4 bangers, with roughly 2 liter engines (mine’s 1.8, and his is 2.2). I have a rather odd theory of down and dirty cheating to make it work:
A) Ideally, air only passes into a cylinder on the intake stroke, which begins at top dead center (more or less).
B) On any even-qty cylinder inline engine, when a cylinder is opening for intake, its opposite cylinder is firing, roughly at TDC.
C) On TBI, only a single injector is used, and opens equally for any cylinder, regardless of which one is opening.
D) On these older engines (still running points), the points open equally for each TDC (with slight shifting due to vacuum advance)
Therefore, my thought is to use the grounding signal from the points (via opto-isolator), to start the injector pulse, and use RPM, throttle position sensor, engine temp, and whatever other sensors I decide to account for (initially, not worried about the O2 sensor, as there’s no such feedback with a carburetor, and I’m trying to keep it simple and cheap) to determine the length of the pulse.
This means that the pulse will need to be initiated at variable times, and the pulse length will need to be variable.
I figure that the red-line is 6000rpm (I’ll add a rev limiter that cuts out the injector above this), and there are two injection/ignition pulses per revolution. This results in in minimum pulse timing of 3ms, and injectors can only use an 85% duty cycle, so at this RPM the pulse width would be variable between the minimum time the injector could be on (which I don’t know at this time, something like 1ms) and 2.55ms.
On the low end, my cousin wants his idle to be about 700RPM, but this isn’t the lowest RPM that needs accommodated. I’m guessing it needs to be stable down to 250 or so.that makes the period (rounded up to) 125ms… which, indeed would be too long to use as an interrupt. The throttle condition near idle speeds with a manual transmission shouldn’t normally be more than like 25-50% I would think, since at this point either you burn the clutch or spin the tires and the RPM goes up. This puts the ‘on time’ for the injector to be below around 60ms, and I doubt it would be all that much more than the maximum fuel use during peak horsepower (somewhere around 2500rpm I’m guessing, which is 1/((2500/60)x2) x 0.85 = 10.2ms). These are strictly assumptions and the actual values and curves would probably be much different, but I’m not to that point yet.
My goal is to have the main program loop calculate the period and pulse duration continuously based on TPS, RPM, and temp (and map if I add one and can figure out how it adds into the calculations), and use an interrupt off of the points to trigger the injector.
This is strictly an off road project (in terms of the Toyota, at least), and while I will be trying to maintain the fuel efficiency of the carburetor he is currently using, increased mileage is not a prerogative. The purpose is to provide him with an easy to swap TBI with a minimum of wires that can operate at high angles (hill and rock climbs). His current carb’s float bowl floods out the engine while in this condition and he loses fine control (half to full throttle or it stalls). He has plenty of access to throttle bodies and other car parts, but has no ability to program stuff and is intimidated by the thought of adding a 22RE wiring harness (his other option). Anyway, I figure this method, if it works, would only cost a controller, power conditioning circuitry, a temp sensor (if I can’t tap into the stock one), some I/O isolation (opto for the coil and a driver for the injector), and a throttle body, which, for him, would amount to a grand total of $50 or less.