58x ECU

Post Reply
User avatar
AngelMarc
Posts: 262
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

58x ECU

Post by AngelMarc »

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.
Attachments
58x4x.JPG
Last edited by AngelMarc on Fri Jun 20, 2025 9:57 pm, edited 4 times in total.
Don't stress specific units.
User avatar
AngelMarc
Posts: 262
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: 58x ECU

Post by AngelMarc »

Yeah, it'll effectively have 20 sensor samples per revolution. Easiest way I can think right now to deal with missing teeth.
That means cylinder pattern match will be async of sensor samples, for V6 full sequential support.
v6...... 20/3 = 6.666666666 .. 60/3 = 20
v8...... 20/4 = 5 ................. 60/4 = 15
V10..... 20/5 = 4 ................ 60/5 = 12 ..... That would be new compared to 24x ECU.
The 24x code already updates sensor data more often than pattern match; so async shouldn't be a big deal.
Don't stress specific units.
MPC001
Posts: 43
Joined: Sat May 05, 2018 9:41 pm

Re: 58x ECU

Post by MPC001 »

Am sure you will come up with something more efficient @AngelMarc, but this works for me for 58X/4X.

Code: Select all

void loop(){ 
	for (x = 1; x <= 120; x++) {
	if ( x <= 58 || x >= 61 && x <= 118 ) { 
        CRK_ON;
        delayMicroseconds(frq1);
	CRK_OFF;
        delayMicroseconds(frq1);
	}
        if ( x == 59 || x == 119) {
        delayMicroseconds(frq1*4);
        } 
	if (x == 25 || x == 55 || x == 85 || x == 115)  {
	CAM_ON;
	}
	if (x == 1 || x == 50 || x == 80 || x == 90) {
        CAM_OFF;
        }
 	}
    }
    
User avatar
AngelMarc
Posts: 262
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: 58x ECU

Post by AngelMarc »

Certainly won't use delay().
will be a "n++" though. Probably a few.
Haven't actually started yet.
Don't stress specific units.
MPC001
Posts: 43
Joined: Sat May 05, 2018 9:41 pm

Re: 58x ECU

Post by MPC001 »

AngelMarc wrote: Sat Jun 21, 2025 12:01 am Certainly won't use delay().
will be a "n++" though. Probably a few.
Haven't actually started yet.
:thumbup:
Post Reply