Initialization

Developer topics relating to software that logs data from ECUs

Moderator: Freon

Initialization

Postby richip » Thu Aug 18, 2005 12:53 pm

I understand that (at least on most Subarus) OBDII and SSM can run on the same hardware line. Is this true? If so, how does one shift from one protocol to the other? Is there a way to initialize either OBD2 or SSM? Is initialization required to shift between the two protocols?

From my understanding, OBD2 uses 19200 8N1 while SSM uses 4800 8N1. Did I get that right? Is it sufficient to just switch device configurations to switch between the two protocols? (That'd be nice if it did.)

Obviously I haven't received my OpenPort, yet, :). I've already written several programs that I can't test. Grr.
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby richip » Thu Sep 08, 2005 7:35 pm

Well, I've managed to purchase a laptop for about $100 and got my cable working. It works well with the SSM protocol via the port under the dashboard on the driver's side, but I can't for the life of me get it to do OBDII. Everytime I try to send something to the port at 19200 8N1, I just end up with an echo of the sent data.

For instance, if I sent out the stream "68 6A F1 01 00 C4" (OBD mode 1 PID 0), I'd just get the same stream ("68 6A F1 01 00 C4") back upon reading.

Has anyone had better luck at getting OBDII to work?
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby fastchip » Sat Sep 10, 2005 6:52 am

The ISO 9141 Baudrate is 10400. You are always getting an echo back because the K-line is bi-directional.
fastchip
 
Posts: 15
Joined: Mon May 30, 2005 9:02 am

Postby richip » Sat Sep 10, 2005 12:40 pm

Thanks for the tip. After feeding google "10400", I found a couple of sites which discuss OBDII better. One of them was the Andy Whittaker site. I've been kicking myself for not perusing that site even more.

At any rate, according to Whittaker, ISO 9141 requires an init of send 0x33 at 5 baud, then read communicate at 10400 baud. I tried this out in software using the tactrix cable and software I wrote. I didn't get the echo and confirm byte of 0x55 that I was expecting after the init byte. At 10400 baud, all I would get from the ECU is the echo.

So it's either: 1) I'm still not doing something right, 2) OBDII isn't supported on this physical port (perhaps another port?), 3) OBDII isn't supported by the ECU or is using some strange, non-standard mechanism, or 4) I've still got the protocol wrong.

Has anyone successfully done OBDII on the port below the driver's side kick panel? This is driving me nuts.

BTW, one thing I've noticed is that the tactrix cable (using the FTDI chip) has a baud_base of 24000000 (as opposed to UART 16550's 115200) so that's good on the accuracy side of things. Thanks, Colby.
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby fastchip » Sat Sep 10, 2005 11:50 pm

OBDII is supported on the K-line. L-line isn't used by Subaru as I can remember correctly. What ECU are you trying it on ?
A 2001 > WRX ECU can be initialized with the 0x33 'CARB' method.
fastchip
 
Posts: 15
Joined: Mon May 30, 2005 9:02 am

Postby richip » Sun Sep 11, 2005 8:39 am

Working on an '05 Legacy GT (USDM) and the tactrix cable (in that same port that works well with the SSM protocol).

Do you have documentation on this "0x33 (CARB) method"? Could you PM it to me if it's too big to post? Or even links to websites would be appreciated.
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby fastchip » Mon Sep 12, 2005 12:04 am

According to the info I have , Subaru uses KWP 2000 on 2005 modelyears.
It is possible that these ECU's don't respond anymore to a 5 BAUD init.
You should try KWP2000 fast initialization.

- Pull K-line 25 ms low
- Push K-line 25 ms high
- Immediately send start communication request C1,33,F1,81,CS
fastchip
 
Posts: 15
Joined: Mon May 30, 2005 9:02 am

Postby richip » Mon Sep 12, 2005 7:08 am

:) I guess I should be happy at the news that my car supports an extended protocol, but now it brings up more questions than I have answers to.

Is it possible to do ISO 14230 (KWP 2000) using the tactrix cable? How does one push low/pull high the K-line programmatically?

I just looked up the price for grabbing the ISO 14230 specs, and it's 188.00 Swedish Francs per document (there are 4 for ISO 14230 and I'm not even sure which one is the one relevant to what I'm doing). They force automobile manufacturers to use these protocols so that home DIY'ers can fix their cars, but make the protocol spec inaccesible to most DIY'ers. :x
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby richip » Mon Sep 12, 2005 9:34 am

Whoops. My mistake. It turns out the protocol isn't open after all, just copyright. It's published (and can be purchased) like a book, but the content can't be published elsewhere. I guess like a book it can be borrowed or lent out, though.
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby richip » Mon Sep 12, 2005 10:15 am

Oh, in case people are interested in ISO 14230-4, it seems the nice Swedes have come up with a similar protocol based on ISO and published it under the names SSF 14230-[123]. One download I've found on the Internet is at http://www.alfa145.co.uk/dl.html
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby fastchip » Tue Sep 13, 2005 4:54 am

How does one push low/pull high the K-line programmatically?

I'm sure Colby can answer that. As far as the KWP2000 protocol is concerned , it should work fine with the Tactrix cable.
fastchip
 
Posts: 15
Joined: Mon May 30, 2005 9:02 am

Postby richip » Tue Sep 13, 2005 8:27 am

fastchip wrote:I'm sure Colby can answer that. As far as the KWP2000 protocol is concerned , it should work fine with the Tactrix cable.

That's all I needed to know. Will continue working on it until I get it functional. Thanks! :D
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby cboles » Tue Sep 13, 2005 9:27 pm

There are two ways to do low speed I/O on the K line of the Openport depending on your situation. The lowest serial baud rate the FTDI FT232BM inside the OpenPort supports is 183 baud, which prevents you from doing things in the standard way.

(1) To send a 25ms "fastinit" pulse, you can send a 0x00 at 360 baud, N, 8, 1 (9/360 = 0.025) which is the trick done in the freediag open source project (see diag_l0_vwtool_fastinit() in diag_l0_vw.c of their project for an example).

(2) To send a "slowinit" address at 5 baud, the problem is more complicated since the FTDI baud rate generator doesn't go this low. The only way I know to do this is to use a "bit-bang" mode supported in the FTDI driver API which allows you to take discrete digital I/O control of serial lines. By twiddling the TX line using FT_SetBitMode() and the internal baud rate generator as your pattern clock, you can make any pattern you want. Unfortunately, you have to use this API instead of the serial port to do it though.

If you are only interested in Subaru, I would stick with the SSM protocol - it's much richer.

Colby
cboles
Site Admin
 
Posts: 1233
Joined: Wed Dec 29, 2004 5:45 pm
Location: Seattle, WA

Postby richip » Wed Sep 14, 2005 12:28 pm

Great stuff, Colby. Now just a couple of more questions, if I may.

Serial comms talk about marks and spaces, whereas the KWP2000 spec deals with high (idle) and low voltages. How do the two correlate? Is mark the low voltage spec? Or is space?

Serial comms also mention a start bit (which is a space) and stop bit/s (designated by a mark). Does the actual hardware device on the vehicle end send the serial comms start bit? Is the device really just the output of the RS-232C signals brought down to the signal level of the K-line spec (12V or something)?

I do apologize for the questions. As I've mentioned, I'm pretty new to serial comms programming and I try to limit my questions to the non-generic ones (ie. cable-specific).

I would use SSM, but the only documentation available, http://www.brendan-stewart.com/other/subaruecu.htm , on it only give a subset. I don't know where else to get more information on SSM short of disassembling the ECU ROM. I'd love to help on that end if you'd like to assign me some code blocks to go through. The only reason I turned my attention to OBDII now is that I hit a brick wall on the SSM front. I can pick up HC16 assembly and disassemble, but I still have to be supervised.
richip
 
Posts: 36
Joined: Sun Aug 07, 2005 8:33 am

Postby MDTURBO » Mon Aug 14, 2006 8:07 am

bump to top.. i'm having same init issues I guess... I read this thread previously but must have missed the how-to on the 360 baud pulse trick. Will see if that fixes my echo issue.

http://forums.openecu.org/viewtopic.php ... c&start=15
MDTURBO
 
Posts: 66
Joined: Thu Mar 16, 2006 8:39 am

Next

Return to Data Logging Software

Who is online

Users browsing this forum: No registered users and 2 guests

cron