Pages: [1]
Author Topic: KWP over K-line. ECU not responding properly to 5 baud init  (Read 9010 times)
Keith-i
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 14



I'm trying to build an interface using an Arduino Teensy to grab OBD data from the ECU in my VW Tdi engine. I've sniffed the communication using a proprietary scanner and it sends a 5 baud init of 0x01 after which the ECU responds with 0x55 etc at 10,400 baud.

My Arduino project sends an identical 0x01 wake-up at 5 baud but instead of getting 0x55 I just get a 1ms pulse back from the ECU and nothing else. Does anyone know what this signifies or what might be wrong? I've used logic and scope analysis on the k-line and I can't see any difference between the 0x01 command being sent between the proper scanner and my device.

Appreciate any help anyone can give.

Logged
woj
Hero Member
*****

Karma: +41/-3
Online Online

Posts: 500


« Reply #1 on: June 13, 2019, 05:38:42 AM »

Your Arduino sketch?
Logged
Keith-i
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 14


« Reply #2 on: June 13, 2019, 10:13:48 AM »

Thanks woj, I should have put some more info. Below is the relevant excerpt from the arduino code I'm using plus some images from the scope and logic analyser.

Code:
bool OBD9141::init(){
    use_kwp_ = false;
    // this function performs the ISO9141 5-baud 'slow' init.
    this->set_port(false); // disable the port.
    this->kline(true);
    delay(OBD9141_INIT_IDLE_BUS_BEFORE); // no traffic on bus for 3 seconds.
    OBD9141println("Before magic 5 baud.");
       
    this->kline(false); delay(200);  // start bit 0
    this->kline(true); delay(200); // first bit 1
    this->kline(false); delay(1400);  // next 7 bits 0000000
    this->kline(true); delay(200);  // stop bit


    // done, from now on in the bus can be treated ad a 10400 baud serial port.

Scope results from proprietary scanner


Scope results from my Arduino device


Logic results from proprietary scanner


Logic results from my Arduino device
Logged
woj
Hero Member
*****

Karma: +41/-3
Online Online

Posts: 500


« Reply #3 on: June 13, 2019, 12:13:01 PM »

I am probably opening a can of worms that do not really want to see but... How is this connected to your Arduino? Are you trying to do k-line directly on Arduino, or do you have UART-to-K-line circuitry (like the KKL cables do) and use the Arduino serial interface? If the former, are you sure your connection is electrically sound?
Logged
Blazius
Hero Member
*****

Karma: +89/-40
Offline Offline

Posts: 1277



« Reply #4 on: June 13, 2019, 12:37:11 PM »

I am not much into this, but are you trying kwp 1281 or kwp2000, if so try kwp1281 slow init ( 5 baud ) ,

here is some info about it, should be what you need

https://www.blafusel.de/obd/obd2_kw1281.html

Its in german but use google translate.
Logged
Keith-i
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 14


« Reply #5 on: June 13, 2019, 02:04:39 PM »

How is this connected to your Arduino? Are you trying to do k-line directly on Arduino, or do you have UART-to-K-line circuitry
I'm using an industry standard k-line interface chip. In fact I've tried two different types just in case, namely L9637 and SN65HVDA195. The logic and scope scans I've provided above are taken from the actual k-line connection so I'm pretty sure everything is electrically correct. As you can see the 0x01 at 5-baud looks identical between my device and the proprietary scanner but for some reason the ECU doesn't respond to mine in the same way.

It is KWP2000 and a slight variant of what is posted on the www.blafusel.de website.

With the proper scanner I can see a response from the ECU of 0x55 0xEF and 0x8F. All I get with my device is a 1ms pulse from the ECU. I'd love to know where it's going wrong!

Thanks for your help.
« Last Edit: June 13, 2019, 02:06:27 PM by Keith-i » Logged
woj
Hero Member
*****

Karma: +41/-3
Online Online

Posts: 500


« Reply #6 on: June 14, 2019, 01:06:58 AM »

Are you trying to read the data on the Arduino side? It probably should not matter, still...

Another thing that should not matter, but that I noticed - your prop. device levels are closer to 12V than your Arduino device. I had my K-line contraptions back in the day working with crappy voltages, so again, that is probably not it either.

Your ECU / Tester does not have an L-line too?

Can your ECU do fast-init too? Did you try that?

Finally, I know the scope does not lie, but I can assure you that doing timing with the delay() function on Arduino is sub optimal if you want to have precision timing. Maybe you are orders of single us too fast and the ECU rejects your signal?

EDIT: And perhaps a question that should be asked in the first place - is your ECU powered / knows that it is powered?
« Last Edit: June 14, 2019, 01:13:50 AM by woj » Logged
Keith-i
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 14


« Reply #7 on: June 14, 2019, 01:50:45 AM »

I've not got as far a trying to read the data on the Arduino. At this stage all I'm trying to do is see a proper response from the ECU on logic or scope attached to the k-line after sending a slow-init wake-up.

There is barely any difference in voltage levels between my device and the prop scanner. Both have highs around 11.3v and lows around 1v IIRC.

There is no l-line on my ECU and I'm pretty certain it doesn't work with fast-init. My proprietary scanner is VCDS and I can see it goes through a comms check process and ends up displaying KWP , 10355 and EF8F. This is obviously KWP protocol, 10355 baud and the expected ECU keyword bits of EF8F. From sniffing it's output there is no evidence of anything but a slow-init working. The ECU is actually on a VW marine engine which is based on the 3.0Tdi block. It only has very primitive diagnostic requirements hence why it is k-line I suppose and not CAN.

Thanks again fro your thoughts and input.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.017 seconds with 16 queries. (Pretty URLs adds 0s, 0q)