Pages: [1]
Author Topic: wake up ecu, (fast init)  (Read 4465 times)
twek
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 1


« on: June 22, 2011, 11:26:01 PM »

Not sure if this is where i should post this.. but i took it upon myself to try to talk to my ECU with a FTDI interface and a VCP driver... cept idk how to get the ECU to wake up!

i tried a multitude of things, the last being setting my baud rate to 360 (9 bits at 360 baud = .25ms?) and send 0x00 tryin to pulse the kline, then i wait .25ms change the baud to 10400 and send 0x81 0x11 0x81 but i get no reply at all.
this is my wakeup function
Code:
            txtBaud.Text = "360";
            serialPort1.BaudRate = int.Parse(txtBaud.Text);
            writeToECU(new byte[] { 0x00 });
            txtBaud.Text = "10400";
            serialPort1.BaudRate = int.Parse(txtBaud.Text);
            System.Threading.Thread.Sleep(25);
            writeToECU(new byte[] { 0x81,0x11,0x81 });

for a while i was just getting an "echo" of what i was sending, but klines are bidirectional (or so ive read) so i wrote a function
Code:
        public void writeToECU(byte[] ba)
        {
            foreach(byte b in ba)
            {
                serialPort1.Write(new byte[] { b }, 0, 1);
                serialPort1.ReadByte();
            }
        }
to read each byte as its "echoed" back
am i doin sumthing wrong?
i dont have much experience in anything but programing but im curious and bored ha

is it because im not waiting the .25 seconds im pulsing the kline?
im running out of ideas ;(
Logged
setzi62
Full Member
***

Karma: +142/-0
Offline Offline

Posts: 249


« Reply #1 on: June 26, 2011, 04:31:39 AM »

Fast init needs very acurate timing of the wakeup pulse and the time until the messsage
is sent, you may deviate just +-1ms from the timing.
Changing baud rates takes too much time and therefore will not work within the wakeup
scenario. Better use something like setBreak/clearBreak controlled by timer functions
to get an exact wakeup pulse.
Measure your wakeup scenario with a logic analyzer to see wether it keeps the
timing contraints or not (I think also a parallel port "logic analyzer" would work).
Logged
Pages: [1]
  Print  
 
Jump to:  

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