Re the "crash" it's not a crash unless it locks solid. If you spun it to a high RPM then yes, things would take longer because you literally run out of processing time. This is a known flaw, however I'm surprised that you got that high with 8-1. The only thing that can cause something like that is a runaway interrupt, not being cleared or being set too often. There are only a handful of interrupts enabled and the chances of that are slim to none, though I don't doubt what you saw, I'm super curious about what the cause was as it doesn't make a lot of sense.
Re the missing event on 360, wording it that way made me realise something. The problems with the code are solved, the problem is with the advice you've been getting. I don't know who this Fred guy is, but he's been giving you bad advice... <runs for cover>
A decoder that is crank based has a 360 span, not 720. A 4 cyl dizzy setup has 180, not 720, and what that means is that the range is zero, up to, but NOT including 360. Hence if you set it at 360, you'll get exactly nothing.
Additionally, you emailed me this:
Code: Select all
anglesOfTDC[0] = 0 * oneDegree; // 1 and 4
anglesOfTDC[1] = 180 * oneDegree; // 2 and 3
anglesOfTDC[2] = 360 * oneDegree; // 1 and 4
anglesOfTDC[3] = 540 * oneDegree; // 2 and 3
outputEventPinNumbers[0] = 0;
outputEventPinNumbers[1] = 1;
outputEventPinNumbers[2] = 0;
outputEventPinNumbers[3] = 1;
#define cliConfigredNumberOfIgnitionEvents 4
Which is wrong in two ways. And I didn't spot it or tell you. I'm very sorry!
Firstly, because it's 360 based, you only configure two, and they are repeated. If you had a 720 sync, and wanted wasted spark, you'd do it the way you have.
Secondly, as I mentioned above, the correct config is 0, 180, which will get you 4 events at 0, 180, 360, 540, just as you want. I'm sorry that I didn't notice this sooner, but I'm sure you'll agree that it actually makes sense once you think about it.
Also, later, there will be a config check, once it's not hard coded, that is. I think there is a comment somewhere saying "check that X angle isn't greater than Y angle" though I could be wrong.
So, reconfigure and post a glorious pic of the correct wave form :-)
Now, ignitors, they don't need voltage, they need current. You can get them to work from 5v, depending on the model and the coil style, but they may work poorly. My testing showed that 5v with NO series resistance produced about 35mA or so, and that best spark was in the 65 to 150mA range, not attainable from 5v. My truck ran on 5v with MS and about 8mA, however it was always prone to spark plug fowling and no timing lights would work on it LOL. Sparks were not very bright. It only worked because it was CNP, really. Additionally, if you get a voltage drop in some grounding to your ignitor or ecu or both, then you can run into the case where you don't get enough voltage to generate the required current and you get no spark. FreeEMS would have run one more engine if not for that. Thus 12v with a current limit resistor guarantees you a sufficient current at the ignitor (which is a big darlington) and thus sufficient current to the coil. I tested the input and output current during my tests, and past about 100mA there was no increase in current or voltage across the coil, however the difference from raw 5v to limited 12v was significant. I also tested the ignitors I had to 1.5A of input current, and they didn't explode. Reason being, that they're limited internally. So don't be scared. Preston verified these tests over gmail chat at the same time in his workshop. hence the recommendations from us both in the Puma bom. The idea there is to keep the circuit mods simple and roll with a huge fet pulling a resistor low to turn off dwell and the resistr pullin the ignitor input high to turn dwell on. This isn't ideal as when you're idling with low dwell duty the ecu will warm up from heat dissipated in the resistors. No big deal, though. The alternatives are worse, ie, new circuit in perf board or inferior and unreliable performance. I hope this helps.
Lastly, if you wanna roll with 5V, you need to build something to drive it, and it needs to be high side with almost no output resistance, mine used 10 ohms. You can't do the pull up and force down thing with 5v as the resistance values required are too low. The XOR chip has max 10mA per pin, which is NOT enough, esp not with appropriate current limit resistors to protect the XOR.
Fred.