Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 08-06-2010, 08:12 PM   #551 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Switzerland
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
iso9141 init keeps failing

Quote:
Originally Posted by dcb View Post
I forget, has anyone tried something like this for ISO? I briefly tried once and failed.


Um, yes, tried it during the last few days, actually ended up using an LM339 comparator-IC for the level-shifting.

On different note: Seeing that you also own a Mk4 VW-Golf - does your arduino work using the ISO9141 protocol? Because mine does not seem to complete the init-sequence.

I used the following interface hooked up to my arduino on a breadboard:




Maybe i already found the mistake: R7 was missing from my test-setup, although the pulses somehow arrived at the RXD pin on the arduino, maybe some internal pullup?
edit: actually, no, that didn't change a thing. Added R7 and eliminated R5, still init failing.


What i saw using my scope was this: 5 baud init sequence sending 0x33 - sync byte reply from the ECU (0x55) and then the obduino seemed to even send something back, which must have been the complement to 0xff.
But then the obduino went into an endless re-initialization loop.

Can anyone give me a tip?

BTW, i used the trunk code, it says v165 on the LCD.


Last edited by schlorkist; 08-07-2010 at 08:38 PM..
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 08-08-2010, 10:22 PM   #552 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: ARG
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
nice job you are doing here.
I have following problems:
Build OBDuino and it works but hangs on Menu screen.

If I try to change defaults ej KM to MPG:

40,
1,
true,

to

40,
0,
true,

it will still display KM.

Any suggestions?
  Reply With Quote
Old 08-09-2010, 07:02 PM   #553 (permalink)
EcoModding Lurker
 
Join Date: Apr 2009
Location: Debolt, Alberta
Posts: 78
Thanks: 1
Thanked 2 Times in 2 Posts
ElectroMike,

I am rebuilding my interface using the ELM chip (as I have need to run in a Ford instead of Toyota...). The Ford currently has the Engine light on (running too lean) so I will be able to test the code. But first the parts have not come in yet and I have not built the ELM interface... I will test out your code for you... sometime soon.

Wish I built the ELM interface to start with...
  Reply With Quote
Old 08-10-2010, 03:27 PM   #554 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Switzerland
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
MC33290 just came in the mail, will try with that soon.
  Reply With Quote
Old 08-11-2010, 06:10 AM   #555 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Lithuania
Posts: 74
Thanks: 3
Thanked 21 Times in 15 Posts
Cool ISO with MCZ33290EFR2 failing on VW Jetta 2001

Hello,

I found your intresting project- i build it with Arduino 2009, and Obduino32K last available v165 on LCD is shown.

But I have problems while initializing ISO - i tried ISO_9141, ISO_14230_fast and ISO_14230_slow - all fails

I measured voltages - comucation is going on, tx/rx is working
I modified Obduino32K and now it displays last ISO_InitStep with "Failled!" message.
And i found that ISO_9141 init process fails at step 9.

After that I tested it with VAG-COM cable and it tests if ISO_9141is working, I see it sending 0X33, and then displays:
hxxp://sos.teja.lt/~eimix/misc/ecommoder/obd_test_complete.JPG
and 0x0808 is received as response

But in Obduino32K source code is expecting:

Code:
        byte b;
        iso_read_byte(&b);  // read kw1
        iso_read_byte(&b);  // read kw2
        
        // send ~kw2 (invert of last keyword)
        iso_write_byte(~b);

        // ECU answer by 0xCC (~0x33)
        iso_read_byte(&b);
        if(b == 0xCC)
        {
           ECUconnection = true;
           // update for correct delta time in trip calculations.
           old_time = millis();
        }
        ISO_InitStep = 0;
Do i missunderstand or my car is responding not what is expected?

Edit: I modified OBDuino32K a bit more and found out:

iso_read_byte(&b); // read kw1
reads: 0x08

iso_read_byte(&b); // read kw2
reads: 0x08

// send ~kw2 (invert of last keyword)
iso_write_byte(~b);
writes: 0xF7 as ~0x08 == 0xF7

// ECU answer by 0xCC (~0x33)
iso_read_byte(&b);
reads: 0x08

i tried replace last read with:
bool b_read;
b_read = iso_read_byte(&b);
and i get b_read = false how could this be?

What could be wrong?

Thank you help.

Last edited by eimix; 08-11-2010 at 08:49 AM.. Reason: Update
  Reply With Quote
Old 08-11-2010, 10:33 AM   #556 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Lithuania
Posts: 74
Thanks: 3
Thanked 21 Times in 15 Posts
Jetta 2001 with ISO is connected! ughu :)

ISO init needs some changes according to
http://www.koch-engineering.com/file...ISO14230-2.pdf
NEW URL
http://sos.teja.lt/~eimix/misc/ecomm...SO_14230-2.pdf
page 14.

Timing issues: need delay before replying ~kw1 and one more delay before receiving 0xCC:

quick hack would be replace

Code:
        // send ~kw2 (invert of last keyword)
        iso_write_byte(~b);

        // ECU answer by 0xCC (~0x33)
        iso_read_byte(&b);
with

Code:
        delay(25);
        // send ~kw2 (invert of last keyword)
        iso_write_byte(~b);

        // ECU answer by 0xCC (~0x33)
        byte i=0;
        while(i<3 && !iso_read_byte(&b))
        {
          i++;
        }
Now it inits well, shows all stuff
After i turn car of - OBDuino32K states trip is saved and turn backlight after while.
But after car is started - Obduino32K is not coming back. Backlight is off, but it responds to buttons. Any ideas?

Last edited by eimix; 04-04-2011 at 05:52 AM.. Reason: url update
  Reply With Quote
Old 08-11-2010, 02:00 PM   #557 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Lithuania
Posts: 74
Thanks: 3
Thanked 21 Times in 15 Posts
ISO Reinit, ECU state and Alarm is not working well

After OBDuino32K is not reinitng ISO by default - i uncomented
#define useECUState
#define do_ISO_Reinit
#define carAlarmScreen
(it's not possible to skip last one - why?)

But now it's probably the same
After i turn car off - LCD stays on, but nothing is changing.
I left it for 10min - nothing happens.

The most strange thing happens then turn key to power up ECU, just before starting engine Obduino32K says - "TRIP SAVED" and shows "OBduino security" for a second.

After that it starts showing PIDs (no difference if engine is started or not).

Does anybody has newer version? why this such intresting project is not evolving anymore?
  Reply With Quote
Old 08-11-2010, 07:21 PM   #558 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Switzerland
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
Quote:
Originally Posted by eimix View Post
ISO init needs some changes according to
hxxp://www dot koch-engineering dot com/fileadmin/projects/OBD_II/ISO14230-2.pdf
page 14.

Timing issues: need delay before replying ~kw1 and one more delay before receiving 0xCC:
Thanks a lot, now also works in my Golf Mk4, and still with my custom iso9141-interface shown in my first post in this thread.
There are a lot of "ERROR"-messages on the screen though, can't really test with the engine on, since it is midnight now.
  Reply With Quote
Old 08-12-2010, 04:09 AM   #559 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Lithuania
Posts: 74
Thanks: 3
Thanked 21 Times in 15 Posts
Problems reading MIL codes

I have simple MIL code 16804 catalyst eficiency below treshhold, it is part of exhaust system (something with cleaning exhaust gas) I'm ignoring it or cleaning it with VAG-COM cable/software.

Today this code came back, and OBDuino32K shows message on start:
CHECK ENGINE ON 1 CODE(S) IN ECU
But it is not showing codes

How to clean those codes with Obduino32K? Is it possible?

Code:
  if(1L<<31 & n)  // test bit A7
  {
    // we have MIL on
    nb=(n>>24) & 0x7F;
    lcd_cls_print_P(PSTR("CHECK ENGINE ON"));
    lcd_gotoXY(0,1);
    sprintf_P(str, PSTR("%d CODE(S) IN ECU"), nb);
    lcd_print(str);
    delay(2000);
    lcd_cls();

#ifdef ELM
    // retrieve code
    elm_command(str, PSTR("03\r"));
    // ELM returns something like 43 01 33 00 00 00 00
    if(str[0]!='4' && str[1]!='3')
      return;  // something wrong

    // must convert to P/C/B/U etc
    lcd_print(str+3);
    delay(5000);
#else
    // we display only the first 6 codes
    // if you have more than 6 in your ECU
    // your car is obviously wrong :-/

    // retrieve code
    cmd[0]=0x03;
    iso_write_data(cmd, 1);

    for(i=0;i<nb/3;i++)  // each received packet contain 3 codes
    {
      iso_read_data(buf, 6);

      k=0;  // to build the string
      for(j=0;j<3;j++)  // the 3 codes
      {
        switch(buf[j*2] & 0xC0)
        {
        case 0x00:
          str[k]='P';  // powertrain
          break;
        case 0x40:
          str[k]='C';  // chassis
          break;
        case 0x80:
          str[k]='B';  // body
          break;
        case 0xC0:
          str[k]='U';  // network
          break;
        }
        k++;
        str[k++]='0' + (buf[j*2] & 0x30)>>4;   // first digit is 0-3 only
        str[k++]='0' + (buf[j*2] & 0x0F);
        str[k++]='0' + (buf[j*2 +1] & 0xF0)>>4;
        str[k++]='0' + (buf[j*2 +1] & 0x0F);
      }
      str[k]='\0';  // make asciiz
      lcd_print(str);
      lcd_gotoXY(0, 1);  // go to next line to display the 3 next
    }
#endif
  }
1. could it be problem with for(i=0;i<nb/3;i++), becouse nb==1, and 1/3=0, so for loop is not starting?

or

2. can not seen any delay in ISO part, so if it displaying - it is for a very very short time and i cannot see?

or is it both problems at same time?

3. after displaying that there are CODE(S) OBDuino32K start showing PIDs, but all of them are wrong -24°C coolant temp, 17ltr/hour (instead of normal 1-2) could this be becouse OBDuino32K sends request for ECU error codes read, but is not reading them and all comunucation becomes corupted?

proposed code:
code not checked jet.
Code:
  if(1L<<31 & n)  // test bit A7
  {
    // we have MIL on
    nb=(n>>24) & 0x7F;
    lcd_cls_print_P(PSTR("CHECK ENGINE ON"));
    lcd_gotoXY(0,1);
    sprintf_P(str, PSTR("%d CODE(S) IN ECU"), nb);
    lcd_print(str);
    delay(2000);
    lcd_cls();

#ifdef ELM
    // retrieve code
    elm_command(str, PSTR("03\r"));
    // ELM returns something like 43 01 33 00 00 00 00
    if(str[0]!='4' && str[1]!='3')
      return;  // something wrong

    // must convert to P/C/B/U etc
    lcd_print(str+3);
    delay(5000);
#else
    // we display only the first 6 codes
    // if you have more than 6 in your ECU
    // your car is obviously wrong :-/

    // retrieve code
    cmd[0]=0x03;
    iso_write_data(cmd, 1);

    // REPLACE: nb/3 with (nb-1)/3+1 //
    for(i=0;i<(nb-1)/3+1;i++)  // each received packet contain 3 codes
    {
      iso_read_data(buf, 6);

      k=0;  // to build the string
      for(j=0;j<3;j++)  // the 3 codes
      {
        switch(buf[j*2] & 0xC0)
        {
        case 0x00:
          str[k]='P';  // powertrain
          break;
        case 0x40:
          str[k]='C';  // chassis
          break;
        case 0x80:
          str[k]='B';  // body
          break;
        case 0xC0:
          str[k]='U';  // network
          break;
        }
        k++;
        str[k++]='0' + (buf[j*2] & 0x30)>>4;   // first digit is 0-3 only
        str[k++]='0' + (buf[j*2] & 0x0F);
        str[k++]='0' + (buf[j*2 +1] & 0xF0)>>4;
        str[k++]='0' + (buf[j*2 +1] & 0x0F);
      }
      str[k]='\0';  // make asciiz
      lcd_print(str);
      lcd_gotoXY(0, 1);  // go to next line to display the 3 next
    }
    // ADD: delay(4000), 5seconds is limit for ISO for NO comunication //
    delay(4000);
#endif
  }
btw, is it possible to get access to google code trunk, i would like to put some new code

Last edited by eimix; 08-12-2010 at 04:41 AM.. Reason: ifo update
  Reply With Quote
Old 08-12-2010, 06:53 PM   #560 (permalink)
EcoModding Lurker
 
Join Date: Aug 2010
Location: Switzerland
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
Quote:
Originally Posted by eimix View Post
3. after displaying that there are CODE(S) OBDuino32K start showing PIDs, but all of them are wrong -24°C coolant temp, 17ltr/hour (instead of normal 1-2) could this be becouse OBDuino32K sends request for ECU error codes read, but is not reading them and all comunucation becomes corupted?
This is the exact same problem that i see too, not very surprising, since it is basically the same car.
Even the RPMs stay fixed at 1040 regardless of actual revolutions.
I think i should output some debugging stuff on a soft-uart.

  Reply With Quote
Reply  Post New Thread


Tags
obd2



Similar Threads
Thread Thread Starter Forum Replies Last Post
MPGuino release one workspace dcb OpenGauge / MPGuino FE computer 1061 01-17-2020 02:37 AM
Just some quick info on Scangauge vs. MPGuino NoCO2 OpenGauge / MPGuino FE computer 4 06-01-2015 05:58 PM
All New Nissan Models to Feature Fuel Efficiency Gauge MetroMPG General Efficiency Discussion 6 11-18-2008 05:57 PM
Vacuum gauge problems :( DifferentPointofView Instrumentation 3 05-15-2008 12:04 AM
Will Scan Gauge work on mine? bennelson Instrumentation 9 02-19-2008 11:04 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com