View Single Post
  #94  
Old 07-14-2019, 06:12 PM
Dispatch20 Dispatch20 is offline
Registered User
 
Join Date: Apr 2019
Location: New York
Posts: 14
Re: OBDII Mt conversion???

In case you're curious and have some programming background, here is my Arduino C software for data logging the TCU data stream. To print out a nicely formatted line of data, I took advantage of the 10 repeating 1's followed by a '0' to synchronize my data capture. The hardware used is an Arduino Uno chinese clone that was $13 on Amazon.

I had to make a couple probe wires to stick in Pin 80 of the ECM and then into the Arduino digital connector pin #2.

Here is information on the ECM connector and a picture of my wire going into it. It's pretty easy to see and find but you need to be pretty flexible to stick your head under the dash.



You also need to create a common ground between the Arduino and the vehicle. I used some alligator clips on the cigarette lighter ground and then to a ground post on the Arduino. If you don't ground the car to the board nothing will work!

Here is a quick video of my prototype setup with the TCU wire, Arduino, and hacked together grounds: https://www.youtube.com/watch?v=F9ddmpcpLQs



Anyways, here is the Arduino software. And you can (hopefully) get the latest copy here: https://create.arduino.cc/editor/Dis...1e9984/preview

Code:
/*
  OBDII SVX TCU Logger

  Reads the 5V serial data stream output from Pin 80 of the OBDII TCU
  
  The purpose is to record the TCU output stream and allow another piece of 
  software to recreate the stream when the TCU is absent.  The primary use
  is to allow a manual transmission swap without throwing a check engine light
  for P1702.

*/

// Use Pin 2 of Uno board to receive the TCU output stream.
int TCU_Output = 2;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(TCU_Output, INPUT_PULLUP);
}

void loop() {
  
  int TCU_Val, Sync_Val = 0;
  
  // Sync up to data stream
  // O-scope showed a consistent 100ms of '1' followed by a '0' and the rest of the 750ms repeating sequence */
   while(Sync_Val < 96) {
    TCU_Val = digitalRead(TCU_Output);
    
    if(TCU_Val == HIGH) {
      Sync_Val++; 
    } else {
      Sync_Val = 0;
      Serial.println("Not Sync'd"); // This should only happen on startup if the Arduino starts logging after the car is turned on
    } 
    delay(1); // 10x oversample for sync (e.g. 1ms sample rate on data that changes at 10ms)
  
  
    // About 95 milliseconds have elapsed which gets us close to 100ms.  
    // The next 0 value after this will indicate the start of sequence.
    if(Sync_Val == 95) { 
      Serial.println("Sync'd!!!!");
      Sync_Val++;  // Value of 96 will exit while loop
    } 
  }
  
  // Stall waiting for TCU to push a zero after the 100ms '1' sync sequence
  // This should only be a few cycles (and you can let it print to serial to prove this)
  while(digitalRead(TCU_Output) != LOW) {
    //Serial.println("Stalled waiting for 0 after sync");
  }
  
  // Once the zero is lowered, we will expect a new bit every 10 ms
  // So lets delay 5ms and sample at the middle of the data valid time (e.g. data is 10ms long, sample at midpoint)
  delay(5);
  
  // read and print out all 64 bits remaining (750ms - 100ms sync '1' - 10ms sync '0' = 640ms/10ms = 64 bits)
  for(int i = 0; i < 65; i++) {
    TCU_Val = digitalRead(TCU_Output);  
    if(TCU_Val == HIGH) {
      Serial.print('1');
    } else {
      Serial.print('0');
    }
    
    delay(10); // 10ms bit rate.  
  }
  // Print a newline then loop back to sync
  Serial.println();

}
Attached Images
File Type: jpg ecm_wire.jpg (302.3 KB, 1383 views)
File Type: jpg Picture.jpg (56.9 KB, 1368 views)

Last edited by Dispatch20; 07-14-2019 at 07:04 PM.
Reply With Quote