View Single Post
Old 04-02-2011, 09:09 AM   #666 (permalink)
gone.s2
EcoModding Lurker
 
Join Date: Mar 2011
Posts: 15

der Öl-Brenner - '01 Volkswagen Jetta TDI
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by eimix View Post
How this changes anything?
Because there are other program instructions between the last byte received and the first byte sent (i.e. checksumming, formatting data, sending to lcd, handling button presses, etc.) and those instructions take time to execute. IIRC the spec is 55ms between last byte transmitted by ECU to next request byte received. The way it is in trunk at the end of the last byte received the program calls delay(x), which does nothing but wait x milliseconds except possibly interrupt handlers. A timeout mechanism like this lets the iso_read_data() function return so those other tasks can be performed. Then if execution gets back to sending another request to the ECU too quickly, this loop waits until the timeout has expired.

It appears with VW ECUs of this vintage, the faster the better.

Quote:
Originally Posted by eimix View Post
And 3s delay before ISO init is something written in specification of that protocol. But as you mentioned that shorter also works, i noticed same "delay ramping" in most of VAG-COM cable software: 0s, 0.5s, 1s ... up to 5s.
This could speed up on ECU that supports it.
With standards, it all comes down to wording. I don't have anything to go by, but I would imagine there's language in there along the lines of "as much as" or "no more than" or something to that effect. Probably the best way to handle reinit as quickly as possible would be to add a self-learning routine, but that would be a lot of program space for little realized utility.

Quote:
Originally Posted by eimix View Post
But for a while i am unable to test code in real (until last tank becomes empty).
I'm sure that deters a lot of ppl from testing. Unfortunately it seems there's an awful lot of code in there than could stand optimization like this. Building an application for a microcontroller that has to handle time-sensitive communication AND user input seamlessly is always difficult. The methods used differ wildly from the way PC applications are written, where CPU time is abundant.

What build version are you currently using, and have you ever gotten reinit to work? I almost had it working last night, but something is failing around the end where supported pids are queried.

Last edited by gone.s2; 04-02-2011 at 09:18 AM..
  Reply With Quote