58x ECU
Posted: Thu Jun 19, 2025 10:16 pm
By modifying my 24x code a bit, I think I can do a similar pattern matching setup, for both the crank and cam signals.
58 zeroes followed by a single one. Measure low and high, multiply high by 2 (or bit shift by 1 for 2x, that's faster), same < or > compare. Since the tooth decoded 0 is a different size, RPM/VE math would either skip that tooth, or do different math. I don't like that last part; missing tooth wheels suck. Might do every 3rd tooth, that interval is the same as the missing teeth gap plus 1 normal tooth. My sensor averaging and the majority of loop code relies on that even spacing.
A little more complex if statement for cam, the pattern being a continuous 0011001100110011.
if 00 or 01, cam phase A. if 11 or 10, cam phase B.
Loop code could probably decode cam outside interrupt.
I'll probably throw something out based on the 24x code at some point.
58 zeroes followed by a single one. Measure low and high, multiply high by 2 (or bit shift by 1 for 2x, that's faster), same < or > compare. Since the tooth decoded 0 is a different size, RPM/VE math would either skip that tooth, or do different math. I don't like that last part; missing tooth wheels suck. Might do every 3rd tooth, that interval is the same as the missing teeth gap plus 1 normal tooth. My sensor averaging and the majority of loop code relies on that even spacing.
A little more complex if statement for cam, the pattern being a continuous 0011001100110011.
if 00 or 01, cam phase A. if 11 or 10, cam phase B.
Loop code could probably decode cam outside interrupt.
I'll probably throw something out based on the 24x code at some point.