I’ve been working on a project where I’m trying to control a diesel injection pump with an Arduino Due. This isn’t something I expect to run a vehicle with, I just want to run an engine on the stand to see if its feasible to pursue this project any further. The pump itself is relatively simple to control once you have the proper hardware interface. Currently there is a peak and hold driver and an internal tone wheel with two separate outputs.
In the attached image the yellow channel is the peak and hold driver, purple is one of the tone wheel outputs, and green is the other tone wheel output. What I’m trying to do is start counting falling edges on the purple signal once the green signal goes low, after X(5 or 6) purple pulses I’ll turn on the peak and hold driver for a set amount of time.
My current code is below and it’s not counting correctly. When channel 3 is low the counter just continues to increment can anybody see what I’m doing wrong?
I’m open to another way to do this, my software skills are rusty so this is the best I could come up with. Thanks in advance.
Tone_Wheel.ino (1.17 KB)