HML087 coding plug ROM for BMW E30 instrument cluster

The E30 instrument cluster for newer models have a coding plug (codier stecker) in front that stores the configuration parameters for SI boards: 6 or 4 cylinders, the maximum RPM, etc.
If you open the coding plug, you can find the chip HML087. It’s a 40-year-old ROM that uses its own communication protocol.

The coding plug pins

Pin Function Description
1 CLOCK The data is sent on its level going from high to low
2 GND Ground
3 +5V Power to the chip
4 GND Ground
5 DATA The output data: high – 1, low – 0
6 GND Ground
7 CS The ROM is selected when the CS level is high
8 GND Ground

Communication protocol capture

The protocol can be captured using a Saleae compatible logic analyzer and the Saleae software.

The coding plug for HML087 1385468 (E30 325i M20B25 7000RPM USA)
hml087_1385468

The communication protocol description.
The pin CS is set high by a microprocessor. Then, the microprocessor sends 64 CLOCK signals. When the CLOCK signal goes from high to low, the ROM outputs data on the DATA pin.

Data from different E30 coding plugs

Coding plug Description 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1385468 E30 325i M20B25 7000RPM USA 0 0 0 0 1 1 0 1 1 0 1 0 1 0 0 0
1380873 E30 M3 S14 8000RPM Europe 0 0 1 1 0 1 0 1 1 0 1 0 0 0 0 0
1377368 E30 325e M20B27 5000RPM USA 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 1
1394321 E30 318is M42B18 7000RPM USA 0 0 1 1 0 1 0 1 1 0 1 0 1 0 0 0
1385364 E30 318i M40B18 7000RPM Europe 1 0 1 1 1 0 0 1 1 0 1 0 0 0 0 0
    16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
1385468   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1380873   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1377368   0 1 0 0 1 0 0 1 0 1 1 1 1 0 0 0
1394321   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1385364   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
1385468   0 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0
1380873   0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0
1377368   0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0
1394321   0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1
1385364   0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0
    48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
1385468   0 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0
1380873   0 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0
1377368   0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1
1394321   0 1 0 1 1 0 0 0 1 0 1 1 1 0 1 1
1385364   0 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0

HML087 emulation

The communication protocol can be emulated by a microprocessor. While the Attiny family looks like an obvious choice, it’s too slow for the application. It will work with older SI boards where the CLOCK signal period is 30 µseconds, but in the newer SI boards the period is 5 µseconds.

HML087 emulator that uses the microprocessor ch32v003

hml087_emulator

hml087_emulator_schema

Here is the software for the BMW E30 coding plug emulator that uses the RISC-V microcontroller CH32V003: https://github.com/faritka/hml087

You can check the timing diagram for the coder.

The CLOCK signal pulse period is 5.583 µs as the programmed coder was inserted into one of the latest SI boards.
When the CLOCK signal changes from HIGH to LOW, the coder reacts after 725 ns (0.725 µs) and sends 0 (LOW) on the DATA line. This delay is acceptable for the latest SI boards.

The CLOCK signal pulse period is about 30 µs for earlier SI boards, and the coder certainly works with them.

coder_diagram

4 thoughts on “HML087 coding plug ROM for BMW E30 instrument cluster

  1. Hello,

    Is this coding plug compatible with all e30 clusters ?
    The reading frequency is not the same for all models ? (30 and 5 microseconds pereiod)

    1. Yes, I tested it with the 3 latest SI boards that I have.
      The ch32v003 is a 48 MHz microcontroller and it’s pretty fast.

      When I ran the code using the ATtiny85 with its 8 MHz frequency, I experienced unacceptable delays. It only worked with early SI boards.
      Other people may use assembler code to make their versions work.

      Though, I can’t guarantee that my code will work with all SI boards.

      1. Thank you for your reply.
        To summarize your answer :
        ATtiny85 didn’t work with the latest SI board (works only with early SI board) -> delays issue ?
        Ch32v003 works with the 3 latest SI board ?

        If this is the case, normally the CH32V003 should work with the early SI board also.

        Do you know what is the clock frequency sent by the latest SI board to the CH32 ?

        1. I added a timing diagram that I measured using my actual coder and the latest SI board.

          If the SI board sends pulses every 5.583 µs, then the frequency is 180 kHz.

          My measured delay is 725 ns. When I used Attiny, delays were 2-3 µs.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>