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

Disassembly, Reassembly, Tools and devleopment. Going deep with Hardware and Software.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: Coding my own aftermarket ECU [beta available]

Post by AngelMarc »

You do not have the required permissions to view the files attached to this post.
Don't stress specific units.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
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
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
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.
EDIT: The "updated pulse handler" addressed this. AI wasn't helpful, had to do it manually. Fuel and spark get 2 functions each, with some extra flags to trigger thing right.
Last edited by AngelMarc on Sun Sep 28, 2025 3:41 am, edited 1 time in total.
Don't stress specific units.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
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
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
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

Turns out I'm out of female headers, but, voltage divider, pull up resistors, and bias resistor in this mess.
DSC02934.JPG
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.
MPC001
Posts: 174
Joined: Sat May 05, 2018 11:41 am

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

Post by MPC001 »

AngelMarc wrote: Sun Jun 22, 2025 11:42 pm 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: 612
Joined: Sat Apr 08, 2023 11:23 am
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: 612
Joined: Sat Apr 08, 2023 11:23 am
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 9:04 am
AngelMarc wrote: Sun Jun 22, 2025 11:42 pm 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: 612
Joined: Sat Apr 08, 2023 11:23 am
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
... or not
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
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
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.