Coding my own open source 24x ECU [beta available]

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

Re: Coding my own aftermarket ECU [beta available]

Post by AngelMarc »

https://www.youtube.com/watch?v=UCtbsBIIFGY
seq.PNG
seq.PNG (71.35 KiB) Viewed 569 times
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

Minor readability change for anybody keeping track.
Swapped the low and high name and inverted the "if >" result.
Purely a readability change. Explained by comment.
Capture.PNG
Capture.PNG (17.7 KiB) Viewed 506 times
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

Currently looking to change

Code: Select all

void handleSparkPulse(uint8_t pin, unsigned long startTime, bool &activeFlag) {
  unsigned long now = micros();
  unsigned long elapsed = now - startTime;

  if (elapsed < currentOnDelaySpark) {
    digitalWrite(pin, LOW);
  } else if (elapsed < currentOnDelaySpark + currentOffDelaySpark) {
    digitalWrite(pin, HIGH);
  } else {
    digitalWrite(pin, LOW);
    activeFlag = false;
  }
}

So dwell can't be effected by rapid RPM change. Might be better to just use a higher dwell: figure out what kind of delta can be created by realistic extreme RPM change deltas over 15 degree increments, and increase main dwell value as needed. And then the same addition done to dwell gets subtracted from main spark table to keep the same spark timing.
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

Should do for testing. 2 cylinder output board. Can test on a couple small engines I have. CB450 and 2 stroke snow blower.
Need to make the input board and add a cam sensor to the CB450 for a full sequential test.
I don't own anything V8.
DSC02932.JPG
DSC02933.JPG
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

MAP sensor is 5 volt. Pi Pico will die from that... Um, good enough.
OHMs.PNG
OHMs.PNG (40.62 KiB) Viewed 400 times

Turns out I'm out of female headers, but, voltage divider, pull up resistors, and bias resistor in this mess.
DSC02934.JPG
Don't stress specific units.
MPC001
Posts: 52
Joined: Sat May 05, 2018 9:41 pm

Re: Coding my own aftermarket 24x ECU [beta available]

Post by MPC001 »

AngelMarc wrote: Mon Jun 23, 2025 9:42 am MAP sensor is 5 volt. Pi Pico will die from that... Um, good enough.
Thanks for reminder. I have been using a 5v map sensor supply into the pico. Must fix it before it kills the pin. :wtf: no smoke yet. Probably as it's mostly at 1-2v.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

How much have you done?
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

MPC001 wrote: Tue Jun 24, 2025 7:04 pm
AngelMarc wrote: Mon Jun 23, 2025 9:42 am MAP sensor is 5 volt. Pi Pico will die from that... Um, good enough.
Thanks for reminder. I have been using a 5v map sensor supply into the pico. Must fix it before it kills the pin. :wtf: no smoke yet. Probably as it's mostly at 1-2v.
Unclear on some details.
Just to be sure we're on the same page...
The power for the Pico is 5 volt, it has a regulator to drop that to 3.3. VBUS and VSYS if I remember right, are 5 volt input. You can remove a resistor or something to separate USB power I think.
Every other pin is not 5 volt capable.
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

"Let's try using TunerStudio as the tuning UI. No live tuning, no flash/burn, just convert the saved file."
Capture.PNG
Capture.PNG (29.74 KiB) Viewed 248 times
... or not
Don't stress specific units.
User avatar
AngelMarc
Posts: 292
Joined: Sat Apr 08, 2023 9:23 pm
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket 24x ECU [beta available]

Post by AngelMarc »

Real tired of this shit.
Capture.PNG
Capture.PNG (6.53 KiB) Viewed 237 times
Capture.PNG
Capture.PNG (46.9 KiB) Viewed 237 times
Don't stress specific units.
Post Reply