Turboing it!
Most of the work on the ECUs I have done with the aim of making them work with a turbo. And smooth too. Hence the need to understand everything that happens there, so no unpleasant surprises would surface out. Also because of this I concentrated on the 8F/18F ECU, this is the one for my turboed engine.
Actually, the most and almost only issue is for the ECU to correctly interpret a wide MAP sensor. I used a 2.5bar one of a Fiat Coupe. Approach A. is to simply connect the MAP to the ECU and pray for the best. This operation will change the scales of MAP dependent maps. For example, 20kPa will roughly stay 20kPa (0.25V on the sensor), while the atmospheric pressure will not show 4.75V any more, but rather something around 2V, while 4.75V will indicate 1.5bar of boost. But scales are not the only thing, all the other MAP dependent calculations will deviate too. Recall, for example, that the fuel base uses a direct readout from the MAP sensor. In effect, your fuel dosages will be at least twice as small as before. Moreover, the ECU will no longer know what an atmospheric pressure is, because it is not at 4.75V any more. A bit messy. If you want to turbo the ECU this way, it will work, but you will need to fully redo the main MAP dependant tables (fuel, ignition) and hope that the rest will work
somehow. You will also loose the resolution of the main maps. Now 2.5bar range needs to fit into 16 cells, instead of just 1bar. In practice this approach works (lots of folks in PL do it this way), but the reports are that the ECU gets flooded with errors, the initial idle is very rough, lambda correction kicks in when not desired etc.
Looks hopeless, doesn't it? Defo not the quality I would expect from a decent turbo ECU. So I planned for simply analysing every single bit of code that uses MAP values in the calculations and rescale the internal values accordingly for the 2.5bar MAP sensor. This also looked hopeless after a while, there is way over 50 places where MAP is used in scales and calculations. Some of the calculations were far from clear too.
But the story has a happy ending, and this thanks to the ECU program itself, and the way it keeps MAP sensor readings. The 8F/18F program is special in this respect, almost as if it were written for a turbo engine

Neither 16F nor 18FD can be subjected to similar trick. The 8F/18F program keeps the current MAP value in two different cells. One is 1-byte cell, with the 0-255 range and the data conversion exactly as in the diagnostics document: DATA * 3 gives MAP pressure in mmHg. The other cell is 16 bits, range 0-65535, and keeps the same value directly in hPa. For example, the hex value of 00FF indicates MAP pressure of 255hPa, while 0400 indicates MAP pressure of 4*255=1020 hPa (practically atmospheric). Most of the range of this 16 bit cell is unused, what a waste! It could in theory store MAP pressures of up to 65bar. Moreover this cell is used for the most important big maps (fuel and ignition).
So, my plan was this. Change the MAP sensor reading procedure (voltage data to actual data converter) so that the 2.5bar sensor is unrecognisable to the ECU when the pressures stay below boost. When, say, the voltage is 2V (roughly) which for the 2.5bar sensor is around atmospheric, the ECU will see FF in the first cell, and 0400 in the other cell. This means you can put 2.5bar sensor into your N/A and still run the engine smoothly. The other part of the conversion procedure is changed such that the second cell correctly records boost pressures, while the small cell treats all boost pressures as atmospheric. So at 4.75V it should store hex 09C4 = 2500 decimal = 1.5bar of boost. The first "small" cell gets locked at FF showing at most atmospheric pressure.
And this is actually enough. So it happens that the small cell is used in all kinds of tables and calculations where boost is (or can be treated as) irrelevant. The big cell is used for the main maps, including the fuel and ignition and this is where we need to know about boost to have additional fuelling and proper ignition. What remains is the size of the MAP scale. It is still 16 cells, killing the resolution of the maps, even though the maps interpret the boost values correctly. After a quick thought I simply resized these scales and related maps to 32 cells for MAP. This allowed me to keep the original 16 cells for under boost values and gave me fresh 16 cells for boost.
This is almost it, but not quite. The ECU program is designed in such a way that MAP pressures close to atmospheric make it go into WOT state, effectively flattening the ignition MAP. Pressing the accelerator to the floor will also cause WOT state, which is now senseless, because despite WOT we can still have a whole range of pressures in the manifold and not just "close to atmospheric" as the ECU assumes. All in all what needed to be done was to neutralise the WOT state all together, simply by wiping out the code that switches a corresponding bit on. Then I also made the MAP pressures that make the ECU go into open loop mode a bit lower, so that I can get proper (below 14.7AFR) fuelling well before the boost kicks in. This was especially needed at lower revs, where close loop is effective until the very end (atmospheric pressure). Talking about auto calibration, I also reset all AC parameters every time the program discovers boost. This is to stay clear of any mess AC can cause in the fuel, see previous part. Also at boost the program gives additional fuel by default, so that the corrections in the main fuel map need not to be drastic (to get 11.5 AFR the main fuel map may run out of value range, hence we need to have extra fuel from the start, then correct it to 11.5). A cherry on top is a poor man's boost control, or rather I should call it boost defender. That is, an additional, ignition cut that also depends on high enough MAP pressure. To prevent unpleasant surprises when the wastegate gets stuck closed or somebody plays with MBC (that I do not have yet

).
There are of course some fine details that I do not write about. The second part of turboing it is to put bigger injectors so that injection times stay within the limit of one engine rotation (see previous parts) even on high boost. This part is easy, I simply rescaled some fuel maps accordingly to the change of the injector size and that did the trick.
Then there was a dyno time to get the tables right on spot, the result can be found in my turbo thread (see my signature). I am also planning to record a short movie showing how this works in practice, but I need to wait for a slightly better weather
