Results 1 to 9 of 9

Thread: Mazda MECS-II PCME

  1. #1
    Tuner in Training
    Join Date
    May 2003
    Location
    Posts
    10

    Mazda MECS-II PCME

    A number of Mazdas (and some Fords) used Mazda's MECS-II (Mazda Engine Control System) PCME ("PCM&quot from the early 1990s until the widespread adoption of the more advanced OBD-II box in the 1996 model year.

    The MECS-II PCM is a two-board architecture, linked by 4 flexible wire connectors. One board, the "analog" board, serves the PCMs analog and I/O functions while the second board, the digital board, contains all the processor, memory, digital-level I/O and so on.

    Since the main focus of this site and the main interest of the average reader is likely the digital side of things, I'll start with that. The processor is a Nippon Denso marked with "151802-8050". Turns out this processor is based on a Motorola 68HC11 core. The processor is housed in an 84-pin plastic quad and is internally expanded: much like an HC11F1, the package brings out the 16-bit address and 8-bit data busses. The processor is clocked by an 8MHz crystal yielding an internal bus clock of 2MHz. Much of the HC11-based feature set is preserved (input captures, output compares, SPI), some appears eliminated (SCI) and some modified (A/D converter). In addition, there are registers mapped to addresses I've not been able to find literature on or if I have found them, the documented function doesn't appear to match the function as it appears in the code.

    The processor itself appears to house 512-bytes of internal RAM of which the first 32-bytes ($00-$1F) are battery backed during ignition-off. Here, learned parameters for fuel, idle control and TPS closed-position are stored. Detection of corrupted memory is performed by storing the compliment of each parameter in the adjacent byte. So, if the parameter at $00 is #$AA, the value stored at $01 is #$55. During boot, the PCM will check each location and its compliment. If a bit has drifted due to battery-disconnect, the PCM resets the whole 32-byte region to default values.

    The processor has an on-board A/D but in this case, it's a 10-bit unit. It seems to have a unique set of addresses, different from, say, the HC11E9. The result registers are 16-bits wide and the A/D value is left-justified. In the code, very often the raw A/D value is right-shifted (e.g. LSRD) 6-bits to bring the result to a "usable" bit position.

    The system uses 3 of the output compares to drive 3 of the fuel injector drivers. The remaining 3 injectors (V6) are driven by a peripheral timer chip (Hitachi 63B40). Another output compare is used to drive the igniter (coil driver) for the ignition. Input captures are used for the camshaft position sensor and two crankshaft position sensors.

    The processor also contains a couple of PWM outputs that are used to modulate the idle air control and EGR solenoids.

    External chips include the aforementioned 63B40, a 63B21 parallel interface, a 27C256 PROM for code and calibration storage (mapped to $8000-$FFFF), a 5564 1K RAM and some inconsequential logic ('138, '74 etc) for address decoding. There's also a 4051 analog multiplexer that feeds one A/D channel a number of low-criticality A/D inputs. A 74HC541 provides buffering for some more inputs.

    An interesting function of the SPI: a 74HC595 shift register and a resistor ladder form a crude but effective D/A converter that is used to help determine the severity (amplitude) of the signal from the knock sensor. A separate pulse accumulator is used to count the frequency of knock events.

    Sadly, the SCI, if populated on the silicon, is not used, therefore a great opportunity lost for serial interfacing. Odd that Mazda would not choose to have serial communications, even as late as 1995, on a wide range of their model line...

    Next post, if you're interested, I'll look at some of the code.



    --&&Mike

  2. #2

    Re: Mazda MECS-II PCME

    Please post more!
    Correct me if I'm wrong but thats the same setup used on mazda powered Escorts right?
    Business Network Solutions - for all your PC, network, printer and computer security needs.

  3. #3
    Tuner in Training
    Join Date
    May 2003
    Location
    Posts
    10

    Re: Mazda MECS-II PCME

    Quote Originally Posted by RoboGeek
    Please post more!
    Correct me if I'm wrong but thats the same setup used on mazda powered Escorts right?
    Yes, I believe so. As well as Mazda MX3s (Precidias), Millenias, MX6s/Probes (I4 MTX, V6), RX-7s (I believe) and so on.

    Rats...I just wrote a really long reply with lots of stuff and when I hit "post", I was told the reply was too long, to go back and shorten it and re-submit. Trouble is, the contents of my reply were lost when I went "back" :P

    Perhaps a "Check message length" option would be nice to prevent losses like this. I can't re-type that right now...maybe later. >
    --&&Mike

  4. #4
    HP Tuners Owner Keith@HPTuners's Avatar
    Join Date
    Sep 2002
    Location
    Chicago, IL
    Posts
    6,395

    Re: Mazda MECS-II PCME

    Doh! I'll look into this.
    We got this guy Not Sure, ...

  5. #5

    Re: Mazda MECS-II PCME

    yea I've done that a few times too.. ;D
    Business Network Solutions - for all your PC, network, printer and computer security needs.

  6. #6
    Tuner in Training
    Join Date
    May 2003
    Location
    Posts
    10

    Re: Mazda MECS-II PCME

    Thanks Magnus...would be a handy feature.

    Back to the PCM. A 27C256 EPROM stores all program and calibration data. In my PCM, the calibration data is largely stored in the first 3.6K of the PROM with some smaller tables, mostly 2-dimensional linearization tables embedded within the program code that covers at least the next 24K within the PROM.

    Initialization begins, as usual, with the setting of the hardware stack. This PCM stores the stack, somewhat unexpectedly, not at the top of the external RAM ($2FFF) but lower down, at $2EFF. The external RAM is mapped from $2C00 to $2FFF inclusive; the choice of stack placement is puzzling.

    Checks of NVM are made and if an error is found, the NVM is reset. Memory in the processor above that protected by battery backup is cleared.


    9647 DE 00 LDX $00
    9649 8C 5AA5 CPX #$5AA5
    964C 26 25 BNE $9673
    964E CE 0002 LDX #$0002
    9651 EC 00 LDD $00,X
    9653 43 COMA
    9654 11 CBA
    9655 26 1C BNE $9673
    9657 08 INX
    9658 08 INX
    9659 8C 001A CPX #$001A
    965C 25 F3 BCS $9651
    965E DC 1A LDD $1A
    9660 43 COMA
    9661 53 COMB
    9662 1A 93 1C CPD $1C
    9665 26 0C BNE $9673
    9667 1A B3 8A8A CPD $8A8A
    966B 22 06 BHI $9673
    966D 1A B3 8A8C CPD $8A8C
    9671 24 53 BCC $96C6


    In the above code, the "integrity system" is clear. Each successive memory location pair is complimented to help catch when a bit drifts as due to, say, a battery disconnect. All learned parameters are 8-bit except that at $1A (complimented at $1C), a 16-bit learned fueling parameter (exact purpose, unknown to me right now) and it's treated outside the main "loop" in the check logic above. Interestingly, if this parameter exceeds upper or lower limits, the NVM is reset (not just in the case of a memory fault.)

    Next...load, RPM and timing...
    --&&Mike

  7. #7
    Tuner in Training
    Join Date
    Dec 2002
    Location
    Posts
    27

    Re: Mazda MECS-II PCME

    im finding this very intresting as it strays from ford 8061 strategy which is so familiar in those years. just weird GM was playing with the 8051 and ford was using a 68hc11 derivative and honda switched from 8051 to 83c451 and chrysler went from 6807 to 68hc11f1a and then nissan and toyota went propriatary. weird years the 3 leading upto obd2. please continue ?? had any sucess with function decoding and is this box generic amongst all msec2 mazdas in slightly modified versions ??

  8. #8
    Potential Tuner
    Join Date
    Jun 2003
    Location
    Posts
    1

    Re: Mazda MECS-II PCME

    Quote Originally Posted by sean
    im finding this very intresting as it strays from ford 8061 strategy which is so familiar in those years. just weird GM was playing with the 8051 and ford was using a 68hc11 derivative and honda switched from 8051 to 83c451 and chrysler went from 6807 to 68hc11f1a and then nissan and toyota went propriatary. weird years the 3 leading upto obd2. please continue ?? had any sucess with function decoding and is this box generic amongst all msec2 mazdas in slightly modified versions ??
    The Probe GT uses a Mazda engine and therefore Mazda engine controller.
    \'93 Ford Probe GT. Mazda MECS-II ECU (OBD-I). 68HC11 based.&&

  9. #9
    Tuner in Training
    Join Date
    Dec 2002
    Location
    Posts
    27

    Re: Mazda MECS-II PCME

    The Probe GT uses a Mazda engine and therefore Mazda engine controller.
    i was aware of that i just find the whole thing fascinating everybody doing the mcu boogie.