Thank you very much :-) One of the reason I have not used your driver for the ignition output, was because my electro engineer friend told me that the regulator was not suitable for the driver that draws 3A. I hope my solution will work out safely.
I am splitting the signal because I want to know were the crankshaft is. I have two magnets on the crankshaft pulley, one facing the latching hall sensor north and one facing it south. When the hall signal goes high, my RISING interrupt routine starts and fires coil A. When it goes low, my FALLING interrupt routine starts and fires coil B. I tried to define both interrupts on one pin, but it did not work.
But my second consern is that i don`t want to mix the arduino 5V circuit with the external 5V circuit to much, whit optocouplers, I feel safe. but should i feel just as safe with a TC4424EPA driver?
*What about mixing processor voltage and external voltage in with the driver?*Is optocouplers to slow? Or is it no problem to fix that with the code?*Is it smart to use an optocoupler to trigger the driver, or does that give away the purpose of using a fast driver?
Processor voltage? I'm not sure what that question means.
The TC4424 can be powered by 5v from your external circuit and triggered by 5v from the Arduino, the 2 signals will remain separate. The separation with a MSOFET isn't quite as good as an opto, but its more than good enough given the circuit that wraps around it.Optos are definitely slower than a MOSFET, but it's not too bad. Reading the datasheet for the TLP504A, the fall time with a 5v trigger similar to yours is around 40uS. I'm not sure how fast you're looking at running your engine, but that is 1 degree at 4000. Not too significant, but worth considering. Remember that you'll be compounding the delay by using an opto on the crank signal and on the output. The reason I suggest the pre-driver (and the TC4424 is particularly well suited for this), is because its designed to do exactly this task. Turning IGBTs or power FETs on/off quickly has certain challenges, so using an IC that is made specifically for doing it is usually a good idea.
microseconds = ProcessTime; // Preset the uS counter variable to compensate for code processing time.