An ECU scan tool for turbo and NA owners

Headlights to tailights and everything in between.

Moderators: Helpinators, Moderators

scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

I'm doing what I call a 'dot test' on it right now, I'm going to go out and try it.

Basically, what a dot test is, or what I've done when I write code and can't figure out wtf is wrong, I'll go in and slap code everywhere I think there could be a problem that basically drops a dot on the screen. in loops with various exit functions, I'll put a character - it's sort of a character dot test, based on the output I can tell what the code is doing, that and by counting the dots.

I can see where it gets, and such.

lemme go run it.

:D

dottest failed. the code shows that it's not reading anything, it's looping back through itself again and again (when trying to read the rom id)

when I selected the serial port (versus the parallel, which is hooked up) the program called .idloop, walked through, then called .expectff (it gave me a dot, then an F on the screen. .F.F.F.F.F.F)

here, i know a little more:

Code: Select all

in xmitpoll:

 .stopbit:
>  push ax
>  xor ah, ah
>  mov al, 'A'
>  call putchar
>  pop ax
  mov al,1
  mov byte [cs:.parity],0


in recvpoll:

 .paritybit:
  cmp byte [cs:.parity],cl             ; check the parity bit
  jne .parerr
   xor bh,bh
   mov bl,[cs:in_end]
   mov al,byte [cs:.buf]
   mov byte [cs:in_buf+bx],al          ; store the new byte in the fifo
>   push ax
>   xor ah, ah
>   mov al,'B'
>   call putchar
>   pop ax
   inc bl
 
yeilds, when tested:

AAAAAAAAAABABABAAAAAAAAAAABABABAAAAAAAAAAABABABA

Ten A's, followed by BABABA (complete recieve, complete send, repeat)

We're getting data, the question is - is this just idle noise on the line, or is the ECU responding?


It's kind of slow to be responding (to recieve those recieves so late)

edit again

timing is right, the software isn't picking up on the sends from the ECU, or something else is wrong - I suspect this is also happening to everyone else who is using this revision of the program.

the B's amongst all those A's were FF, FE, and E7 in that order. I did a puthex call right after recieving the byte

Code: Select all

  call byteready
  jz .done
   call readbyte                        ; expect ff,fe,??,romid
   call puthex
   or dl,dl
there are no other calls, the software reports recieving the FF - not the FE or the E7 (as denoted by the character thing I did)


Vikash, your turn.


edit again: 11:08PM

Code: Select all

<Whimsy> scuzzy: You try 0xff?
<Whimsy> That's how I always did hex numbers in nasm.
<scuzzy> ohhhh
<scuzzy> damnit
<scuzzy> why did you say that right before I went to bed
WIll try in the morning.

this is what it looks like that I'll try in the morning, incase anyone is interested:

Code: Select all

getid                                  ; try to get rom id; al=0 on failure
 pusha
 call clrscr
 mov word [cs:cursor_loc],40*2
 mov bx,word [cs:portstr]
 call putstring
 mov ax,word [cs:baseport]
 call puthexword
 mov al,'.'
 call putchar
 mov word [cs:cursor_loc],80*2
 mov bx,.readstr
 call putstring
 xor bh,bh                             ; offset in commands
 xor dl,dl                             ; how many bytes we've read
 .idloop:
  push ax
  mov al,'.'
  xor ah, ah
  call putchar
  pop ax
  mov al,byte [cs:.commands+bx]        ; send the next byte
  call sendbyte
  inc bl
  and bl,7                             ; keep walking through commands
  call byteready
  jz .done
   call readbyte                        ; expect ff,fe,??,romid
   call puthex
   or dl,dl
   jz .expectff
   cmp dl,1
   je .expectfe
   cmp dl,2
   je .expectany
   cmp dl,3
   je .expectromid1
   cmp dl,4
   je .expectromid2
   mov byte [cs:romid+2],al            ; last byte of rom id
   jmp .gotid
  .expectff:
   push ax
   xor ax, ax
   mov al, 'F'
   call putchar
   pop ax
   cmp al,0xff
   jne .notff
   mov dl,1
   jmp .done
   .notff:
     push ax
     xor ax, ax
     mov al, 'X'
     call putchar
     pop ax
    xor dl,dl
    jmp .done
  .expectfe:
   push ax
   xor ax, ax
   mov al, 'E'
   call putchar
   pop ax
   cmp al,0xfe
   jne .expectff
   inc dl
   jmp .done
  .expectany:
   push ax
   xor ax, ax
   mov al, '?'
   call putchar
   pop ax
   inc dl
   jmp .done
  .expectromid1:
   cmp al,0xff
   je .expectff
   mov byte [cs:romid],al
   inc dl
   jmp .done
  .expectromid2:
   mov byte [cs:romid+1],al
   inc dl
  .done:
  in al,64h
  test al,1                            ; check if there's a scancode ready
  jz .idloop
   in al,60h                           ; read the scancode
   cmp al,81h                          ; and see if it's escape-up
   jne .idloop
  popa
  xor al,al
  ret
  .gotid:
   push ax
   xor ax, ax
   mov al, 'G'
   call putchar
   pop ax
   mov al,12h                          ; send a 'reset' message
   call sendbyte
   xor al,al
   call sendbyte
   call sendbyte
   call sendbyte
   popa
   mov al,1
   ret
 .commands:
  db 78h,0ffh,0feh,00h                 ; read 0fffeh
  db 00h,0ffh,0ffh,00h                 ; request rom id
 .readstr db 'Reading ROM ID...',0
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

OK. I know more this morning.


the 0x (versus 0??h) is right, and the software is responding properly to it (giving me the right screen codes when the signal comes across the line)

the problem: the software isn't sending the right codes or something to such an effect.

Here's the symptoms. If I cut my car off, and give it a moment (ECU relay turns off) and then turn it back on, fire up the software (my version with the 0x stuff - or any version of the 0.06 release)

the software is sending stuff, but the ECU isn't responding to it (no data on the recieve port).

If I start the 0.05 software, and initialize the rom ID, then turn that software off, and start the 0.06 stuff, I see traffic on the recieve port of it sending me the same data over and over.

the same problem exists, however, we're not sending the right stuff to the ECU to make it go "hey, shutup and listen"


I'm going to modify the program to show me what's being sent and see if I can't figure out what the hell is going on.


I think I'm on the right track here.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Woah, dude, thanks for doing all this detective work! I was gonna reply to your email but I guess we may as well do this here.

Not everybody is having this problem for whatever reason. At least one person (myself) hasn't had problems using this new version of the scantool. But, yes, for some reason it's either not transmitting, not receiving, or not doing either correctly.

"0xff" and "0ffh" are both correct ways to express that number in NASM; NASM is pretty flexible:

http://nasm.sourceforge.net/doc/html/na ... tion-3.4.1

Try something real quick -- leave your cable connected to the laptop, but jump the transmit and receive wires together instead of connecting the cable to the car, and run the unmodified scantool. It should immediately read a ROM ID of 00 00 FF. I presume it won't, but let's just quickly check.

Also, do you by any chance have another computer with a parallel port on it? Cuz then we could test by hooking them to each other, and running the old version on the other computer, to figure out whether it's transmission or reception that's not working.
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:Woah, dude, thanks for doing all this detective work! I was gonna reply to your email but I guess we may as well do this here.

Not everybody is having this problem for whatever reason. At least one person (myself) hasn't had problems using this new version of the scantool. But, yes, for some reason it's either not transmitting, not receiving, or not doing either correctly.

"0xff" and "0ffh" are both correct ways to express that number in NASM; NASM is pretty flexible:

http://nasm.sourceforge.net/doc/html/na ... tion-3.4.1

Try something real quick -- leave your cable connected to the laptop, but jump the transmit and receive wires together instead of connecting the cable to the car, and run the unmodified scantool. It should immediately read a ROM ID of 00 00 FF. I presume it won't, but let's just quickly check.

Also, do you by any chance have another computer with a parallel port on it? Cuz then we could test by hooking them to each other, and running the old version on the other computer, to figure out whether it's transmission or reception that's not working.

Allright, I was at work when I read your post so I didn't have the opportunity to go out to my car. so I took a paper clip...

00 FF FF.


Did it on the unmodified, also compiled my own version from a clean unmodified source, same result.

So I figured, bad cable? I plugged my cable up, unhooked it from the car, same results, all versions of the code gave me the exact same results.

Hmm. The oddity is that the 0.05 version works just fine, each and every time.

Now, I'm completly lost.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Wow. So am I.

This is on the same laptop that wouldn't talk to the car with 0.06?
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

Allright, I did this as well, I used my desktop as the other test bench and the cable from my car to do the test with. using 0.05 and 0.06 both produce the same results, transmit and recieve (I did one data line at a time), 00 FF FF on both PC's

didn't matter if I used 0.05 on the desktop or the laptop, both the same.


Ball is in your court Vikash. :)
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:Wow. So am I.

This is on the same laptop that wouldn't talk to the car with 0.6?
yes, same laptop.

do you have AIM or something? let me know, I use it at work for work purposes, but I think it'd be easier (and quicker :D) instead of shooting back and forth emails or forum posts.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Yeah, it would be quicker. Maybe we can pick a time when we can go on irc?
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
Splinter
Knowledgeable
Knowledgeable
Posts: 3058
Joined: Tue Aug 02, 2005 11:12 pm
Location: Victoria, BC

Post by Splinter »

Hey whoa, you can diagnose the parallel port with this?

So if I should a paperclip into the socket and run the program, it should read a ROM id of some sort?

What about using the serial port?

I'm still trying to figure out whats wrong with this damned thing
98 Steel Widebody RSTi-RA Superbeast
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Oh, yeah, dude, why didn't I think of that when you were asking about the parallel port?! Sorry about that. Yes -- try shorting the transmit and receive wires together and see if it reads a bogus ROM ID.

Try with version 0.05 first, in case the same bug scuzzy's seeing would also manifest itself on your computer.
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
Splinter
Knowledgeable
Knowledgeable
Posts: 3058
Joined: Tue Aug 02, 2005 11:12 pm
Location: Victoria, BC

Post by Splinter »

Does it repeatedly poll for a rom ID?

For instance, if I start the program, get to the reading rom ID stage, and then short it, should it still work?
98 Steel Widebody RSTi-RA Superbeast
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

It does repeatedly poll, though you can't always rely on that repeated polling working in real life. In this case, though, it should work.
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:Yeah, it would be quicker. Maybe we can pick a time when we can go on irc?
That's awesome, I get off work at around 5-5:30PM CDT, I'm usually home by 6PM CDT


I logged into irc.servercentral.net and joined #legacycentral - So you'll find me there later on, I'm there right now but may get pulled away. I've been busy since I came back from lunch, we had a drive fail in a machine which was running a lab instrument - so I've been trying to recover important data on that, but anyway.


So yeah, I'll be there. I use mIRC instead of the java client because java seems to break.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Oh, I don't think I can do it tonight... We'll have to pick a time later on. Maybe early next week? In the meantime we can continue going back and forth here or by email.
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:Oh, I don't think I can do it tonight... We'll have to pick a time later on. Maybe early next week? In the meantime we can continue going back and forth here or by email.
that's fine, no problem at all.

do you have any ideas that I can try in the meantime or what? I'm out of ideas. from what I can tell the software should be sending the right set of commands, but why the ECU isn't responding I don't know...


rock and a hard place eh.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
Splinter
Knowledgeable
Knowledgeable
Posts: 3058
Joined: Tue Aug 02, 2005 11:12 pm
Location: Victoria, BC

Post by Splinter »

dealership wouldnt plug in the ssm without charging me the minimum shop time


it takes 30 seconds... ugh
98 Steel Widebody RSTi-RA Superbeast
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

scuzzy - All I can think of is that somehow the timing isn't coming out right...

Well, do you have another computer with a parallel port? Maybe you could try hooking the two up to each other (send to transmit and receive to transmit) with 0.05 running on that computer and see them not work. That could at least reassure us that we're not crazy.
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:scuzzy - All I can think of is that somehow the timing isn't coming out right...

Well, do you have another computer with a parallel port? Maybe you could try hooking the two up to each other (send to transmit and receive to transmit) with 0.05 running on that computer and see them not work. That could at least reassure us that we're not crazy.
Yeah, I think I already told you I did that...

they work.. both computers report 00.ff.ff as a rom id.


I swear I'm not going crazy, honestly. 0.05 works GREAT, 0.06 doesn't work a damn bit.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

You hooked the two computers to each other? Version 0.05 talked to version 0.06?
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:You hooked the two computers to each other? Version 0.05 talked to version 0.06?
correct



like I said, all it said was rom id: 00.ff.ff but they both acknowledged that at least. Then I went back to work, and came home later to find my harddrive had failed. I played with that all night and now i'm back up and going (no important data lost)
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Yeah, that's all they would do.

Wait, 00.ff.ff? Or 00.00.ff?

Sucks about the hard drive. :(
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:Yeah, that's all they would do.

Wait, 00.ff.ff? Or 00.00.ff?

Sucks about the hard drive. :(
00.ff.ff both versions every time.

yeah, wasn't a big loss. good reason to upgrade to a sata drive.
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Oh, wait, yeah, 00.ff.ff is right. Hrm. :?

Mmmm, SATA. 'Memmer back when parallel meant fast and serial meant slow?
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
scuzzy
Third Gear
Posts: 775
Joined: Sun Feb 20, 2005 1:53 am

Post by scuzzy »

vrg3 wrote:Oh, wait, yeah, 00.ff.ff is right. Hrm. :?

Mmmm, SATA. 'Memmer back when parallel meant fast and serial meant slow?
Indeed I do.

Now, fix the scantool! or at least point me into another direction :D
91 Legacy Wagon, Total Rally Car.

#82 M4 TRSCCA Rallycross

http://www.youtube.com/mobilepolice/
vrg3
Vikash
Posts: 12517
Joined: Sun Nov 03, 2002 2:13 am
Location: USA, OH, Cleveland (sometimes visiting DC though)
Contact:

Post by vrg3 »

Ummm... well, try making it print out each byte it receives. We shouldn't do that in recvpoll, since that's part of the timer ISR, so do it in the readbyte procedure. Something like:

Code: Select all

readbyte                               ; read a byte into al
 push bx
 .wait:  
  call byteready
  jz .wait
 xor bh,bh
 mov bl,byte [cs:in_start]
 mov al,byte [cs:in_buf+bx]
 inc byte [cs:in_start]
 and byte [cs:in_start],0fh
 pop bx
 pusha
 mov bl,al
 mov al,'<' 
 call putchar
 mov al,bl   
 call puthex
 mov al,'<'  
 call putchar
 popa
 ret
Maybe that will give us some insight into what's happening.
"Just reading vrg3's convoluted, information-packed posts made me feel better all over again." -- subyluvr2212
Post Reply