Pages: [1]
Author Topic: KW1281 Connection Problem after 5 baud init  (Read 11120 times)
JUCED
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5


« on: June 08, 2019, 04:45:56 PM »

Hi! I'm trying to build an on-board computer for my VW Golf 4 (1998), the ECU is a MSA-15 and the protocol used is KW1281 (verified with VCDS + VAG COM KKL). With arduino i'm trying to read data from OBD using L9637D, after i do the 5 baud init the ECU answer me correctly with 0x55, 0x01, 0x8A. After that, i don't know how to proceed, i read that the microcontroller should send 0x75 confirmation but i tried and it's not working. Any ideas?


Thank you.
« Last Edit: June 08, 2019, 04:58:18 PM by JUCED » Logged
JUCED
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5


« Reply #1 on: June 14, 2019, 09:05:14 AM »

What i should do after 5 baud init? i tried everything. Fast init it's not supported that's why i'm using 5 baud slow init.

This is the simple circuit i'm using:



It should work because i get correct response  Undecided

This is the code:

//5 Baud Slow Init

  digitalWrite(TX, HIGH);
  delay(5000);
  digitalWrite(TX, LOW);
  delay(200);
  digitalWrite(TX, HIGH);
  delay(200);
  digitalWrite(TX, LOW);
  delay(1400);
  digitalWrite(TX, HIGH);

  Serial.println(F("##### Answer reading #####"));
 
  for(byte n=0;n<6;n++) 
  {
    Serial.print(softSerial.read(), HEX);   //It answer correctly 0x55 0x01 0x8A
    delay(500);     
  }


After that, i send 0x75 (the complement) but i get no response  Tongue
 

« Last Edit: June 14, 2019, 09:09:11 AM by JUCED » Logged
Keith-i
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 14


« Reply #2 on: June 14, 2019, 11:59:08 AM »

I can't help much at all, but if you are using software serial on your Arduino I have read that this is not great at timing so might be causing you problems with your baud rate.
Logged
JUCED
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5


« Reply #3 on: June 14, 2019, 12:57:02 PM »

I can't help much at all, but if you are using software serial on your Arduino I have read that this is not great at timing so might be causing you problems with your baud rate.

The problem here is that i successfully receive 5 baud confirmation 0x55 0x01 and 0x8a but after sending 0x75 i have nothing.... i'm using altsoftserial, every sketch i saw on internet use a software serial and they have no problems. I also tried a sketch from "Alexander’s car diagnostic software (OBD KW1281)" but can't get it to work :/
Logged
Keith-i
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 14


« Reply #4 on: June 14, 2019, 01:24:49 PM »

I gather there is something called 'newsoftserial' which I have read people referring to as solving their issues. If I can find a link I'll let you know.
Logged
JUCED
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5


« Reply #5 on: June 14, 2019, 05:42:06 PM »

I gather there is something called 'newsoftserial' which I have read people referring to as solving their issues. If I can find a link I'll let you know.

already tried that, not working Sad
Logged
tao13
Sr. Member
****

Karma: +17/-47
Offline Offline

Posts: 471


« Reply #6 on: January 02, 2020, 09:38:25 AM »

did you selecte tx as output and high? need some delay!
try this

pinMode( txPin, OUTPUT ); 
  digitalWrite( txPin, HIGH );
  delay( 2000 );
  digitalWrite( txPin, LOW );
  delay( 200 );               
  digitalWrite( txPin, HIGH );
  delay( 400 );
  digitalWrite( txPin, LOW );
  delay( 400 );
  digitalWrite( txPin, HIGH );
  delay( 400 );
  digitalWrite( txPin, LOW );
  delay( 400 );
  digitalWrite( txPin, HIGH );
  delay( 200 );
  softSerial.begin( 10400 );

it works for me in a k-line sketch for arduno but the k-line is very slow and now try to use only can
Logged
prj
Hero Member
*****

Karma: +1072/-481
Offline Offline

Posts: 6037


« Reply #7 on: January 02, 2020, 10:11:56 AM »

You probably have wrongly configured the baud rate or the stop/start bits.
Also don't wait too long to send 0x75. Of course don't send it TOO fast either, there are some communication timings to take care of.

In your example you have a 500ms delay there. For every printed byte!
3 bytes - 1500ms delay, where you don't answer ECU.
That's too much! It will close comms, that's why you never get reply to your 0x75.

It's been a long while since I wrote a KWP1281 tool. But IIRC after 0x75 the normal "ping pong" should initiate.
Watch the timing and get some elementary coding basics down.
« Last Edit: January 02, 2020, 10:13:38 AM by prj » Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
SoulEater
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 1


« Reply #8 on: April 17, 2020, 06:22:01 AM »

Hello all,

Have you managed to make it work?

I'm currently trying to read my Skoda Octavia 1999 ECU. I'm sure it has no CAN, only K-line.

I'm kind of confused about which direction should I follow.

Either buying AutoDia OBD 409 cable or like you use L9637D.

I appreciate any help.
Logged
Pages: [1]
  Print  
 
Jump to:  

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