“Connectors 0, 1 and 2 are on the ESP/ETS/ASR module - no.1 is the CAN wires.
Connectors 3 and 4 are engine ECU - you can again see the CAN wires in plug 4.
All the rest are on the K40 module, which is mainly involved with voltage supply and starter output. 11 is the starter relay, 12 is switched and permanent live supply, 6,7,8,9,10,13,14 and 21 are power outputs and inputs to eg switch the internal relays in the K40 (there will be 2x probably, in addition to the demountable starter relay).
Fuses are obviously there to protect the voltage outputs.”
Thats a picture of the early PMS injection/ignition ECU. By 1997 a new HFM system had been adopted which possibly has a very different looking ECU. You can tell which system is being used by looking at the inlet system - that's why I asked you to post a picture of the engine compartment?
Your car runs a lost spark system from two coils hidden inside a recess in the camcover.
one coil fires 1 and 4 and the other 2 and 3. You could have a faulty coil or the "signal "wire from the ECU is damaged or the power transistor in the ECU has gone. These can be repaired relatively easily.
You need to check several things first the HT coil and its connector/lead first. Then the coils low voltage supply. These can all degrade due to heat under that cam cover "oven" If you swap over the coils and the misfire shifts from 1-4 to 2-3 then there's a good chance its the coil. Where are you based?
If it has the same 4 CYLINDER M111 engine it will be similar but I think in 97 the car moved to a canbus system meaning they would not be directly interchangeable. Some earlier W202 cars with an HFM ECU [ the 2.2 litre for example] would be but not your one.