In keeping with my philosophy of keeping it simple, how about this idea, dump the ADC altogether, and use the CCP input to read the signal pulse duration. Bruce has posted an example how to do it using Darrel's Instant Interrupts. Instead of a pot to adjust, just read two buttons, up and down. I think you could get far greater resolution than you will turning a pot, and you could read the buttons using interrupts, or watch them in a loop. Wouldn't the four input signals, and the four injector pulses be pretty much identical for each revolution? I wonder if you could just read one or two input pulses on each revolution, and make all the outputs identical. Given the mass of the pistons and the fact that they are connected to the same crankshaft I'd be surprised if there needs to be a great variance between cylinders on a single revolution. If you can assume that the input signals and output signals would be identical that makes you job a lot easier, one timer would do it. I'm thinking that having an up and down button would allow a rider to make adjustments on the track, not just on a dyno, it would be hard to tweak a pot while sitting on a bike at speed, and eventually you will likely want to get this on the road I imagine. Your software could adjust the range of adjustment based upon the rpms of the engine, so at higher rpms you couldn't make a drastic change if you held a button too long, but at lower rpms holding the button could make a faster (greater percentage) change.
Jerry.
Bookmarks