The Top DSM Community on the Web

For 1990-1999 Mitsubishi Eclipse, Eagle Talon, Plymouth Laser, and Galant VR-4 Owners. Log in to remove most ads.

Please Support Rix Racing
Please Support Rix Racing

General On-board Diagnostic Between Mitsubishi ECU Using Arduino

This site may earn a commission from merchant
affiliate links, including eBay, Amazon, and others.

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

rizal

Probationary Member
6
1
Jun 2, 2013
Penang,Malaysia, Asia
Hi all, I'm Rizal and I'm from Malaysia. First of all, please guide me if this post was posting in wrong forums channel and also for my English.

Just to share with all of you that i have wrote an article about how to use Arduino to communicate with 1g Ecu. The article were split into part by part because the project is under development. I will update it time by time. So far I've successfully connect the Arduino to Ecu and pull out some of data like engine RPM and battery voltage.

Here is my first article from my blog:

On-board Diagnostic Between Mitsubishi ECU Using Arduino - Part 1

Introduction
This project is about an On-board diagnostic tool for ECU car made by Mitsubishi around years (90-96). I'm using Arduino as the main devices for the medium of communication. The main focus of this project is to display all the data received on the dashboard of the car by using the LCD display. Beside that, i also have a plan to display it using a mobile phone or tablet.

Protocol
Honestly, It took me a long time to get a proper information regarding communication / protocol between the ECU. This is caused by several factors including the information sought is limited, the lack of equipment and in addition there are also some people do not tend to share information due to commercial factors.

Before the analysis described below is done, I have provided some devices to get more detail on how MMCd Logger communicate with the ECU. Later on, all the information will use as input to develop a logger with Arduino. The devices are:

  • ALDL to RS232 adapter as communication tool between ECU and Palm. Download full schematic diagram here. An ALDL voltage describe by Wikipedia as "The signaling of ALDL is very similar to the RS-232 [ame="http://en.wikipedia.org/wiki/Serial_communication"]serial data[/ame] standard; differing in the voltages used to denote logical one (usually 0VDC) and logical zero (either +5VDC or +12VDC), and that unlike RS232, both transmit and receive functions are on the same conductor."
  • [ame="http://en.wikipedia.org/wiki/Palm_III"]Palm IIIc[/ame]
  • 8 Channel Logic Analyzer
  • MMCd Logger version 1.8
  • Logic Analyzer Software

For a note, MMCd Logger is PalmOS automotive diagnostic and data logging tool compatible with many pre-OBDII (1990-1994) Mitsubishi vehicles and it was very popular among Mitsubishi users including DSM cars.

Based on logical analysis software, I found that the communication between the ECU and MMCD Logger is based on; for each 1 byte command was sent, the ECU will respond with 2 bytes of data. Here are the results of analysts that has been made:

  • Serial communications rate is 1920 baud, 8 bits, 1 stop bit, no parity, TTL. (On MMCd web site stated it communicate at 1953 baud rate but both have replies.)
  • Communication signal is "Inverted"
  • Communication referral as 1 byte sent and 2 bytes as a data receive
Here is some sample of signal wave received from the ECU. For record, the signal generated below was taken from my 4g91 ECU.

You must be logged in to view this image or video.


You must be logged in to view this image or video.


Will be continue....
 
Continue from the last part

Hardware
The following lists are the items required for this project:

  • Arduino
    So what is Arduino? "Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments." You can get more detail information about Arduino at here. There are various types of Arduino at market. For the development of this project I use Arduino UNO R3 and other type of Arduino clone still can be use. If you on budget you can build Arduino standalone by your self. Here some of the tutorial how to make it:

    # Standalone Arduino / ATMega chip on breadboard

    # arduino-standalone | Conversations with spaces

    # Google Search

  • ALDL to RS232 adapter
    I'm using this schematic diagram to made the adapter. Please use this diagram for our tutorial process.

    Please take a note that there is some modification I've made by adding a 1 hex inverter 7404 ic in process of building the pcb. The purpose of 7404 IC is to intervention the Arduino serial signal instead using using another RS232 to TTL adapter. By the way this board is under development because there is some error found which made my the LCD shown unknown character.
    You must be logged in to view this image or video.

    The prototype 2 layer PCB version of Mitsuduino Shield using 7404IC and MAX232

  • dfRobot rs232 to ttl converter
    It used to convert the serial signal to our ALDL adapter. You can also use other type of adapter as long it can convert the signal between rs232(serial) to ttl 5v signal.
    You must be logged in to view this image or video.
  • 16x2 Character LCD
    It used to display the value we get from the ECU. You can get the cheapest on the ebay "keyword 16x2 lcd"
    You must be logged in to view this image or video.
Okey we have finished on preparation the hardware side but not done on wiring/cabling :p, i will write about it for next article and also on the software part including the simple coding for Arduino to display the result we got into LCD Display.
 
Last edited:
The ALDL protocol is pretty well documented in the E931 reverse engineered source code available on the DSM-ECU yahoo group Files > 1g > e931_disasm > E932_E931_commented_source.zip

As you figured out it's all 1 byte commands but there is only a one byte response. What your seeing is the echo of the command from the datalogging device cause by using a multiplexed data line.

I can't remember if I've written it up here in the past. Here's the commands:

;
; Diagnostic mode - Process Datalogger Commands
; 0x00 - 0x3d return values from memory based on datalogger map @ d000
; 0x3e - 0x3f return value for 0x3d from memory based on datalogger map @ d000
; 0x40 - 0xf0 return value from that memory location except for 0xca
; 0xca clears faults (Not supported on <91 ECU)
; 0xf1 turns on Boost Control Solenoid for 6 seconds
; 0xf2 turns on MIVEC or VICS motor for 6 seconds (Not Used on DSM)
; 0xf3 turns on EGR Solenoid for 6 seconds
; 0xf4 turns on Fuel Pressure Solenoid for 6 seconds
; 0xf5 turns on Purge Solenoid for 6 seconds
; 0xf6 turns on Fuel Pump for 6 seconds
; 0xf7 turns off Injector 6 for 6 seconds (Not Used on DSM)
; 0xf8 turns off Injector 5 for 6 seconds (Not Used on DSM)
; 0xf9 turns off Injector 4 for 6 seconds
; 0xfa turns off Injector 3 for 6 seconds
; 0xfb turns off Injector 2 for 6 seconds
; 0xfc turns off Injector 1 for 6 seconds
; 0xfd returns 0xb5 (ECU Version)
; 0xfe returns first byte of map value @ 0xfb32 indexed by config resistors
; 0xff returns second byte of map value @ 0xfb32 indexed by config resistors (Engine Code)
;

The source has most of the memory variables defined so you can see which commands get what.
 
Hi Steve, thanks for correcting me about it. I've just read you post at here and the discussion there, :rocks: made me clear about the echo part.

Once again if anyone found any mistake please let me know.
 
Last edited:
I've been banned from the DS-MAP forum for pointing out inconvenient facts by the owner. I'm glad you found my posting useful but I'm afraid I won't be able to provide any additional assistance there.
 
Hi all, just posting the picture of the project. Will update the article and also make a correction about ecu protocol.

You must be logged in to view this image or video.


You must be logged in to view this image or video.


For video please visit my website
 
Mitsubishi ECU - OBD Command Code and Protocol
OBD Command
Since there is a mistake on my first post regarding of the protocol, I've made some more research on that. Here is the result on how the ecu response to the command.

Based on Christia999 code, I found the OBD command code was setting at here (refer to picture 1 and picture 2 below)

You must be logged in to view this image or video.

Picture 1 (The OBD Command)

You must be logged in to view this image or video.

Picture 2

If we look further on the code comment, the OBD code were divided into few table ranges to store the variable value. Here are the table range comments by Christia999:

Code:
;******************************************************************
;*
;* OBD interface queries, commands
;*
;* Codes from $00 to $3d: Regular queries, return the value of the
;* variables showed in obdTable located below,
;* see each variable definition... First value in table
;* correspond to obd query code $00, increases by 1
;* for each table value
;*
;* Codes from $3e to $3f: Converted to $3d, see that obd code
;*
;* Codes from $40 to $c9: Returns what is stored in that ram address
;*
;* Codes from $ca to $ca:: Erase all fault codes and returns $00 if
;* engine not rotating. If engine is rotating, all
;* actuators/injector commands are reset and $ff
;* is returned.
;*
;* Codes from $cb to $f0: Returns what is stored in that ram address
;*
;* Codes from $f1 to $fc: Injector/actuators commands, returns $ff if
;* successfull
;*
;* $f1: Activate boost control solenoid
;* $f2: Unused in code
;* $f3: Activate egr solemoid
;* $f4: Activate fuel pressure solenoid
;* $f5: Activate purge solenoid
;* $f6: Turn on fuel pump
;* $f7: Disable injector #6 (inoperative in code)
;* $f8: Disable injector #5 (inoperative in code)
;* $f9: Disable injector #4
;* $fa: Disable injector #3
;* $fb: Disable injector #2
;* $fc: Disable injector #1
;*
;* Codes from $f1 to $ff: Special queries
;*
;* $fd: Serial link test, returns $b5 (E931) or $b7 (E932)
;* $fe: resistor strapping low word from t_strap3
;* $ff: resistor strapping high word from t_strap3
;*
;******************************************************************

So how does it work? Let say we want to get the RPM value from the ECU. So the command we should be use is 0x21 (based on Mitsubishi ECU command that I've posted before). Whenever we send 0x21 command, the ECU will look-up at the variable value of the table which can be refer at the picture below.

You must be logged in to view this image or video.


So it is prove that the function for RPM is correct where RPM function is y=31.25*x and x is a value response by ECU.

Communication Signal
As I've wrote before, the communication with the ECU can describe as below:

  • Serial communications rate is 1953 baud, 8 bits, 1 stop bit, no parity, TTL.
  • Communication signal is "Inverted"
  • Communication referral as 1 byte sent and 1 bytes receive

There are some people a little bit confuse including me about the multiplexing communication. [ame="http://en.wikipedia.org/wiki/Multiplexing"]Wikipedia explain[/ame] that multiplexing (also known as muxing) is a method by which multiple analogue message signals or digital data streams are combined into one signal over a shared medium.

You must be logged in to view this image or video.

Multiplexing communication between ECU

Reference:

  • E931/E932 source files with comments and symbols.
  • [ame="http://en.wikipedia.org/wiki/Multiplexing"]Multiplexing[/ame] on Wikipedia
 
Hi Rizal!

How is this project progressing?
Do you have any arduino code to share?

Keep up the good work.
 
Yeah Nova. :)
I thought i would read up on some RS232 code before i jump in the deep waters.
Our project we work on at our forum will take it steps beyond this tho. ;)
 
Well i guess that Rizal's project died... To bad since it looked promising. I think he was over-complicating some parts of it. Mostly how to handle the ECU serial protocol. That part is really well documented since years back.

I have got me a Arduino Mega 2560 and a RS232 converter board. You can use any MAX232 IC if you want to convert the signals from/to RS232 levels to TTL levels. It's a small circuit and does not cost more than a few dollars. Most already got the logger cable at hand. This cable can be re-used. But if you prefer you can make a stand-alone version with all hardware included in one circuit. The cable is just a diod and a resistor...

Since i cannot use a LCD yet as the display and misc parts are my GF's x-mas present to me, i have used Processing to display the logged values. Anyhow here's my proof of concept video:


[ame=http://www.youtube.com/watch?v=1tUvW-7S3iQ]SwD and Arduino Working Logger With File Saving - YouTube[/ame]
 
Thanks Broke! :)

Well your wish is my command. Here's the latest version:


You must be logged in to view this image or video.


And here some screenshots:

You must be logged in to view this image or video.



You must be logged in to view this image or video.



You must be logged in to view this image or video.
 
Last edited by a moderator:
Curtis what beef you have with others, don't bring it to me please. I have nothing to do with it. I certainly don't deserve that considering my hard work i put into this...

Why basshead? Well this is a old account i have had on tuners since 2007 and never used it since i feared my english would be too bad for a mainstream forum of this size.

So yes my real name is Kim H. aka KaxLon aka swedish_gvr4 aka basshead (both on here and on the yahoo DSM ECU group).
(Did you miss that info in my signature or are you just trying to provoce me too?)

I have nothing to hide, never had.

Jeff O, Steve, Dave W, and most of the other big names know me well.
Even Mark M at TunerPro since i wrote the first original logger ADX for the DSM ECU for TunerPro.

Sell you software, I don't care. Mine is free and it's real speed density without any residual MAF code.
The logger software will be free too. Oh by the way my hi-speed logger mod for the standard E931 base code is already out there.

So Curtis, Leave me alone please.
 
Keep this on topic please, your other post was removed for flaming let's not continue to do so.

Thank you,

I thought this was the newbie section ?

Where is the source code or is this only for one person / secret forum ?
 
Arduino code is open source and you can Google for whatever project you are trying to build. It has a very large following. As far as dsm code, there's a Yahoo page that has been set up for that. The dsm 1g code has been disassembled and has some handy comments to help guide you to what you want.
You could start there if you are looking for source code.
 
Nope just showing what magical things happen when 20+ year old hardware falls in love with 21st century hardware.

I do not understand the bad thing about this. YouTube is a excellent way of showing progress on new stuff. Virtually anyone that has a story to tell does it. It's fast and it catches alot of peoples interest and may even spark interest in some to start out coding. Or modding existing code and hardware like we do.
These past years some of us has even shown that things considered impossible in the past is actually very possible with proper knowledge and enthusiasm. That including myself.

Try YouTubing for Arduino and you will see all kinds of "self promotion" going on. Everything from the authors of Arduino and the open source community to kids of young age doing some really amazing stuff.
 
Last edited:
Okay look, whatever problems hakcenter and the other parties have with one another in this thread I'm going to ask again that you all stop with the nonsense. This thread started and continued with helpful and seeming informative information before this "quarrel" so get back to the topic please.

-John
 
Thanks for the support guys. Every one of you know the 100's of hours and the amount of cash i have put into this project.

Curtis i am flattered you are following my videos on Youtube. They are pretty amazing, right? I am not talking about camera skills now since i know those suck.
If i was to share my ECU code you wouldn't have a single clue on how to use it, i am sorry to say that. But that is the hard truth. You simply lack the knowledge and the will to learn.
I tried a few times on the old forum you ran back in the days. I dropped the bomb when i released the first DSM ADX for TunerPro. You were not interested. At all. If you had shown just a little interest you would have solved that slow logging speed used in your software. Parsing at 1 second intervals is just painfully slow and i pointed out the dangers of that.
My code runs the slowest at 100 polls/second and can do up to 300 polls/second. That code could have been in your software. But i am very glad i never showed you how to do that.
Second is that i tried pointing out built in flaws and weaknesses that your code had, once again you told me your not interested. Well the rest is history.

Thing is you can never use my code since it has a very distinct signature, and a disclaimer that states you are not allowed to even download it.

The port expander is way beyond your skills since it involves some external hardware and a timing protocol. You really need fundamental understanding of timing of interrupts, ALDL, and so on to make it work.

The Arduino code on the other hand you can come up with yourself. It's really easy.
It's even easier to just copy/paste my example code since i have already put it up at a forum and i have never said i will post anything like that here.

I recognize that the GUI you made for Nicks code is useful, but it's still a beginners tuning software compared to ECMlink, Swede Density, etc.
It could have been great. But it simply fell into the wrong hands.

This will be my last post on this subject since i have no beef with you and i wish to be considered a serious user and coder on this and other forums.
Good luck on your future endeavours.

To the moderators and admins, you may clean up my post it you think i was flaming, but i am clearly just defending myself from a attack i surely do not deserve. And from a person demanding me to release source code that is written from the ground up using no known mods from the Yahoo DSM ECU group.

I will not write anymore in this thread. I will start a new thread when i feel like i have something to share.

Thanks.


PS. Yes there is a SwD in the making for the EVO123 ECU, and i might start looking into the 2G ECU's this spring. :)
PEACE!
 
It looks like a lot of reading comprehension fail here.

Basshead are you going to start up a new thread of the same type, ardy to DSM, so you won't have to worry about cluttering up this thread with your own information and source ? I seemed to me you didn't want to clutter this particular thread.

BTW the stock 1g logging can't be any faster it's 1ms polling, and it does not reuse sensor data like tunerpro does. You should know this by the link in this thread by the original poster. Tuner pro only appears to be polling fast but only 1 sensor is actually updating per line. If you've upped the baud rate it helps by a very tiny margin, the whole section needs a rewrite.

If I had a ECU I could use my Jim stim from a 454 build, but I don't so I work with what I have.
 
Support Vendors who Support the DSM Community
Boosted Fabrication ECM Tuning ExtremePSI Fuel Injector Clinic Innovation Products Jacks Transmissions JNZ Tuning Kiggly Racing Morrison Fabrications MyMitsubishiStore.com RixRacing RockAuto RTM Racing STM Tuned

Latest posts

Build Thread Updates

Vendor Updates

Latest Classifieds

Back
Top