I noticed some huge voltage variations on the arduino logs. You got intermitten drops to 11.8,12.5 and so on.
Where you get voltage reference. Maybe the coils overload the B+ cable or the ground source is weak.

You don`t have voltage drop on the PCM side. At PCM you have constant 13.8-14.2 voltage.

64 bit interger for time isn`t too much. PCM use 16 bit value and the range is $4000-$88 and the conversion is 983040/x = rpm
0.015234*x = msec.

Maybe some scaling can help optimize the routine.

I do compare the logs and the spark calculation are fairly accurate. At constant 28 degree at PCM you get 28-27 at arduino.
If you consider ALDL streamed data can save substantial cpu time at a later stage I will give you precise instructions.
The data is streamed all the time from the PCM{so called idle traffic] so you just need to listen {passive} for the correct frame. The message can be reconfigured to provide any data:rpm,voltage,spark,dwell,map,afr,coolant.

Maybe a basic version that works with all system and platforms 92-97 and enhanced version developed later for specific platform with all the limitations overcomed for extreme accuracy.


I think that matching commanded spark with the spark calculated from the arduino will be good enough. A good indicator will be engine start time. A few degrees off at cruising is alot so it needs fine tuning and calibration.

I guess the hesitation was due to spark retarded too much, since nothing in the log indicates something wrong.

I am not that good at C++ but will take a look. Hope there are some comments.


I will try to log some data with negative spark soon. Will remove the spark correction limit form eehack and force some negative spark.
Negative spark looks possible but for very limited conditions. I do some maths and -17 degrees is the max you can get, than the PCM will freak out and command the max advance of 46 degree.
In the logs -1 will be $80 or 128 since $ff is slashed by 2. I figured it out later.