HOWEVER. Progress has been made. I spent some time over at the pgmfi.org forum and found that a lot of people have done a lot of work to communicate with the older Honda ECUs.
I've found the 3 pin initialization sequence (always the most annoying part when dealing with older ECUs!), the baud rate and parts of the communication protocol thanks to the work they've done on pgmfi.org.
Hooking up an arduino (less than a tenner nowadays) to the Prelude's 3 pin connector and to my laptop's USB I can seemingly read data from the ECU.
Here's my (adapted) code for the arduino:
Code: Select all
#include <SoftwareSerialWithHalfDuplex.h>
SoftwareSerialWithHalfDuplex dlcSerial(12, 12, false, false);
void setup() {
Serial.begin(9600);
while (!Serial) { };
dlcSerial.begin(9600);
}
void dlcInit() {
int initSequence[] = { 0x68, 0x6a, 0xf5, 0xaf, 0xbf, 0xb3, 0xb2, 0xc1, 0xdb, 0xb3, 0xe9 };
for (int i = 0; i < sizeof(initSequence) / sizeof(initSequence[0]); i++) {
dlcSerial.write(initSequence[i]);
}
delay(300);
}
int dlcCommand(byte cmd, byte num, byte loc, byte len, byte data[]) {
// largely taken from https://github.com/kerpz/ArduinoHondaOBD
// checksum FF - (cmd + num + loc + len - 0x01)
byte crc = (0xFF - (cmd + num + loc + len - 0x01));
unsigned long timeOut = millis() + 250;
memset(data, 0, sizeof(data));
dlcSerial.listen();
dlcSerial.write(cmd); // header/cmd read memory ??
dlcSerial.write(num); // num of bytes to send
dlcSerial.write(loc); // address
dlcSerial.write(len); // num of bytes to read
dlcSerial.write(crc); // checksum
int i = 0;
while (i < (len + 3) && millis() < timeOut) {
if (dlcSerial.available()) {
data[i] = dlcSerial.read();
i++;
}
}
if (data[0] != 0x00 && data[1] != (len + 3)) {
return 0;
}
if (i < (len + 3)) {
return 0;
}
return 1;
}
void serialPrintRPM(int rpm) {
Serial.print("RPM: ");
Serial.print(rpm);
Serial.println("");
}
void loop() {
byte dlcdata[20] = {0};
int rpm = 0;
if (dlcCommand(0x20, 0x05, 0x00, 0x02, dlcdata)) {
// apparently the format is different between ODB1 and ODB2. For
// now, print both.
serialPrintRPM(dlcdata[2] * 256 + dlcdata[3]);
serialPrintRPM((1875000 / (dlcdata[2] * 256 + dlcdata[3] + 1)) * 4);
}
// delay a tad so we don't get flooded with serial data (and we can
// read it!)
delay(3000);
}
All in all, not bad for a couple of bits of wire and a few hours research. There's code out there that will transmit the raw K-line data over bluetooth so apps like Torque can read it, completely negating the need for any Hondash reader specific to old Hondas.