Uwe-
i tried what you suggested. i got no response back
from the '96 jetta.
i'm looking at the ISO 9141-2 spec and i see that the
0x08's are 7 bits, not 8 bit as is the 0x33.
is this my problem? should i switch to 7 bits when
waiting for a reply?
please see attached source...
--- Uwe Ross <Uwe@...> wrote:
> > Date: Fri, 1 Jun 2001 08:31:43 -0700 (PDT)
> > From: rick retter <big2rret@...>
> > Subject: Re: Re: How to communicate with a ECU
> >
> > I'm more interested in doing OBD-II code (as in
> the
> > SAE 3000 manual).
>
> For OBD-II:
>
> Send 0x33 @ 5 baud, 1 stop, no parity.
> The address 0x33 is reserved for ODB-II under
> ISO9141-2.
>
> Then wait for 0x55, 0x08, 0x08 at 10.4k.
> That's as far as I've gone with the OBD-II stuff.
>
> If you get the 0x55, 0x08, 0x08 back, you know the
> car "speaks" OBD-II
> (and your '96 Jetta does). From there, you'll need
> to consult the
> OBD-II protocol specs which are readily available.
>
> > ps - i think it's quiet because most people on
> this
> > forum want free (illegal?) software - they sure as
> > heck don't want to write code!
>
> It's been said that Linux wouldn't exist today if
> some of the other
> Unixes had been available at a reasonable cost years
> ago.
>
> VAG Software is available from my website.
> http://www.Ross-Tech.com
> In shareware form (no time limit!) it does quite a
> bit of useful stuff.
> The full-function registered version costs a
> whopping $99, and that
> includes future updates and full software support.
>
> OBD-II software is available for $62 from Alex
> Peper.
> http://www.obd-2.com
> I'm not sure his "standard" version will run through
> the opto-isolated
> interface, but he has a special version that will.
> His software won't
> communicate at all until you enter an activation
> code. Prior to buying
> his software, use the OBD-II compatibility test in
> my VAG-COM program to
> verify that your interface works and that your car
> is ISO/OBD-II
> compatible.
>
> -Uwe-
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/ --0-846930886-992360948=:23030 Content-Type: text/plain; name="uwe.txt"
Content-Description: uwe.txt
Content-Disposition: inline; filename="uwe.txt"
main(int argc, char **argv)
{
if (argc != 4)
fatalError("Usage: iso9141init [1 | 2] [tx | rx] [baudrate]");
//which com port to use is passed in-
int port = atoi(*(argv+1));
--port;
char str[3];
strcpy(str, *(argv+2));
int baudrate = atoi(*(argv+3));
time_t startTime;
time_t endTime;
time_t elapsedTime;
GFComWin32 ComWin32(port);
GFSerial Serial(&ComWin32);
GFDataFormat DataFormat(&Serial);
int ret(99);
//ret = DataFormat.BaudRate(baudrate);
ret = DataFormat.SetUp( baudrate, 'N', 8, 1 );
if (ret != GCPP_OK)
fatalError("could not set baud rate");
//flush tx buffer
Serial.TXFlush();
int initChr = 0x33; // 'A'
int c = 0x00;
while (1)
{
if (strcmp(str,"tx")==0)
{
/////////////////////////////////////////
//send out initialization char at 5 baud:
/////////////////////////////////////////
ret = DataFormat.BaudRate(5);
Serial.PutChar(initChr);
Sleep(2000);
while (Serial.TXCount()!=0);
cout << "sent:" << "0x33" << endl << flush;
//////////////////////////////////////////////////////
//wait for 0x55 0x08 0x08 response at 10400 baud:
//////////////////////////////////////////////////////
ret = DataFormat.BaudRate(10400);
Serial.RXFlush();
startTime = time(NULL);
do
{
c=0x00;
Serial >> c;
endTime = time(NULL);
elapsedTime = endTime - startTime;
}while(c==GCPP_TIMEOUT && elapsedTime<ELAPSED_TIME_IN_SEC);
if (c!=GCPP_TIMEOUT)
printf(" received:%x elapsedTime=%d sec\n", c, elapsedTime);
startTime = time(NULL);
do
{
c=0x00;
Serial >> c;
endTime = time(NULL);
elapsedTime = endTime - startTime;
}while(c==GCPP_TIMEOUT && elapsedTime<ELAPSED_TIME_IN_SEC);
if (c!=GCPP_TIMEOUT)
printf(" received:%x elapsedTime=%d sec\n", c, elapsedTime);
startTime = time(NULL);
do
{
c=0x00;
Serial >> c;
endTime = time(NULL);
elapsedTime = endTime - startTime;
}while(c==GCPP_TIMEOUT && elapsedTime<ELAPSED_TIME_IN_SEC);
if (c!=GCPP_TIMEOUT)
printf(" received:%x elapsedTime=%d sec\n", c, elapsedTime);
Sleep(5000);
}
else
{
ret = DataFormat.BaudRate(5);
do
{
Serial >> c;
}while (c!=initChr);
printf("%x,", c);
if (c != GCPP_TIMEOUT)
{
ret = DataFormat.BaudRate(10400);
Serial.TXFlush();
Serial << 0x55;
Serial << 0x08;
Serial << 0x08;
Sleep(500);
}
}
}
--0-846930886-992360948=:23030--
Received on Tue Jun 12 08:51:30 2001
This archive was generated by hypermail 2.1.8 : Wed Jan 02 2008 - 00:56:04 CET