- Capture.PNG (42.59 KiB) Viewed 404 times
Coding my own open source 24x ECU [beta available]
Re: Coding my own aftermarket 24x ECU [beta available]
looks impressive until you try to use it and get nowhere.
Don't stress specific units.
Re: Coding my own aftermarket 24x ECU [beta available]
Apologies. My bad. Got my pots mixed up. MAP pot on ECM not Pico. Speed pot on Pico.AngelMarc wrote: ↑Wed Jun 25, 2025 9:28 amUnclear 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.

Re: Coding my own aftermarket 24x ECU [beta available]
Ah, you're using the signal generator on your E40 still?
Don't stress specific units.
Re: Coding my own aftermarket 24x ECU [beta available]
The numbers to put in to achieve desired spark advance in each RPM zone of main spark table.
Numbers are for the full sequential setup.
These numbers account for the fixed 4millisecond dwell.
Bottom is same numbers rounded without decimals.
Numbers are for the full sequential setup.
These numbers account for the fixed 4millisecond dwell.
Bottom is same numbers rounded without decimals.
Don't stress specific units.
Re: Coding my own aftermarket 24x ECU [beta available]
Here are waist spark numbers. Just subtracted the microseconds per 360 degrees.
Negative number just means you can't do it. Those negatives start at over 11,000 RPM though.
This is what I meant by opening up the dwell window for higher RPM.
Negative number just means you can't do it. Those negatives start at over 11,000 RPM though.
This is what I meant by opening up the dwell window for higher RPM.
Don't stress specific units.
Re: Coding my own aftermarket 24x ECU [beta available]
Yes! Looking for torque calculation table/s. In E38/E67 etc ...TQ calc done using co-efficient math & available as virtual torque tables in the tuning tools like the virtual VE tables, but E40 not exposed. Hopefully something simpler compared to E38 E67 floating point math.

Re: Coding my own open source 24x ECU [beta available]
Never understood what the fuck a "mol" is.
Just looking for good starter numbers for the CB450.
Calculations I can put in google sheets. Make it a little easier to give people instructions they can follow.
Going to start with some false assumptions,
like 100% volumetric efficiency at all RPMs.
1 millisecond injector dead time.
I'll have a choke knob to play with to get an idea how far off I am.
Just looking for good starter numbers for the CB450.
Calculations I can put in google sheets. Make it a little easier to give people instructions they can follow.
Going to start with some false assumptions,
like 100% volumetric efficiency at all RPMs.
1 millisecond injector dead time.
I'll have a choke knob to play with to get an idea how far off I am.
- Attachments
-
- Capture.PNG (58.22 KiB) Viewed 217 times
Don't stress specific units.
Re: Coding my own open source 24x ECU [beta available]
Alright, 6314 microseconds. 24 lb/hour injectors (2012 Jeep patriot), 222 cc cylinders of CB450, sea level or 105 KPA.
Just going to lazily divide that number for lower MAP values, not consider MAP sensor's actually minimum or maximum voltage at those pressures, and just plug the numbers in.
Just going to lazily divide that number for lower MAP values, not consider MAP sensor's actually minimum or maximum voltage at those pressures, and just plug the numbers in.
Don't stress specific units.
Re: Coding my own open source 24x ECU [beta available]
After I get the cam sensor added, going to try the CB450 full sequential with this tune.
Ended up padding lowest and highest MAP values. Spark range is 5 to 35 degrees.
Code: Select all
volatile int IATFuel[129] = {128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,256,258,260,262,264,266,268,270,272,274,276,278,280,282,284,286,288,290,292,294,296,298,300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,356,358,360,362,364,366,368,370,372,374,376,378,380,382,384};
//Comment above and uncomment below for no temp scaling, 256 = 100% or no change
//volatile int IATFuel[129] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256};
//volatile int IATSpark [129] = {128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,256,258,260,262,264,266,268,270,272,274,276,278,280,282,284,286,288,290,292,294,296,298,300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,356,358,360,362,364,366,368,370,372,374,376,378,380,382,384};
//Comment above and uncomment below for no temp scaling, 256 = 100% or no change
volatile int IATSpark [129] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256};
volatile unsigned long Limiter = 260 ; //Spark cut rev limiter, microseconds per 15 degrees. divide 2,500,000 by this number to get RPM. Limiter is set after rolling average and before being constrained for table access, can be set beyond table limits
volatile unsigned long EOIT [17] = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500};// these were test values, also in microseconds, change as needed
// 0 RPM ---------------------------------------------------------------------------9600 RPM same 600 spacing
volatile unsigned long Dstart [17] [17] = { //lower numbers = more advance, numbers are in microseconds
{5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333, 5954333},//"0" RPM
{194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611, 194611},// 600
{95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305, 95305},// 1200
{61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740, 61740},// 1800
{44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958, 44958},// 2400
{35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166, 35166},// 3000
{28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407, 28407},// 3600
{23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579, 23579},// 4200
{20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131, 20131},// 4800
{17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450, 17450},// 5400
{15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305, 15305},// 6000
{13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424, 13424},// 6600
{11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972, 11972},// 7200
{10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743, 10743},// 7800
{9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591, 9591},// 8400
{8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685, 8685},// 9000
{7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892, 7892} // 9600
};//low KPA --------------------------------------------------------------------------------- high KPA
volatile unsigned long Iend [17] [17] = { //injector on time, in microseconds
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},//"0" RPM
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 600
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 1200
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 1800
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 2400
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 3000
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 3600
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 4200
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 4800
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 5400
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 6000
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 6600
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 7200
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 7800
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 8400
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 9000
{421, 421, 842, 1263, 1684, 2105, 2526, 2947, 3368, 3789, 4210, 4631, 5052, 5473, 5894, 6315, 6315},// 9600
};//low KPA --------------------------------------------------------------------------------- high KPA
Last edited by AngelMarc on Fri Jun 27, 2025 3:01 pm, edited 1 time in total.
Don't stress specific units.
Re: Coding my own open source 24x ECU [beta available]
Here's this by the way.
LS firing order.
LS firing order.
Code: Select all
const uint8_t pattern0 = 0b01111101;//0 degrees 1,6
const uint8_t pattern1 = 0b01110011;//90 degrees 8,5
const uint8_t pattern2 = 0b11000101;//180 degrees 7,4
const uint8_t pattern3 = 0b01000001;//270 degrees 2,3
Don't stress specific units.