Page 1 of 1

DTC Codes Reading

Posted: Wed Jan 29, 2020 11:48 pm
by RTDesigns
Hi guys!!

I have an issue, quite similar to another guy posted a time ago.

I am making an DIY OBD2 diagnostic tool based on ATmega32U4 and an STN1110 OBD2 protocol chip, all with a 2.42" OLED and a 3D printed case.

When I read DTCs I get this here from the serial port:
2 DTC: - 61116111 - 59005900

So the codes I get are 6111 and 5900. Those DTCs does not exist, so I tried to online convert it to hexadecimal and got 17DF and 170C. So I guess the DTCs are P17DF and P170C, seems to have some logic. P17DF is not existent for BMW (can´t find it) and P170C means an oil solenoid transmission issue (normally on automatic transmission I guess). I know exactly the engine has crankshaft sensor issues, and is a BMW e46 compact with manual transmission, so I really don´t understand why these codes or what am I doing wrong....

Here I post my piece of code:

void DTCreading() {

byte dtcCount = obd.readDTC(codes, 6);
if (dtcCount == 0) {
#ifdef DEBUG
USBSerial.println("NO DTC");
noDTC();
delay(3000);
#endif
} else {
#ifdef DEBUG
USBSerial.print(dtcCount);
USBSerial.print(" DTC:");
#endif
for (byte n = 0; n < dtcCount; n++) {
//DTC[n] = String(codes[n], HEX);
DTC[n] = String(codes[n]);
#ifdef DEBUG
USBSerial.print(" - ");
USBSerial.print(codes[n], HEX);
#endif
}
#ifdef DEBUG
USBSerial.println();
#endif
showDTC();
while (digitalRead(ENTER) == LOW) {
//Wait until ENTER pressed
}
for (byte n = 0; n < dtcCount; n++) {
DTC[n] = "";
}
}
}

There I have the part DTC[n] = String(codes[n], HEX); why it does not convert to hexadecimal 17DF, and it still keep decimal 6111?

I guess this is the only part to keep solving, and I feel a little bit lost, any help would be grateful.

Regards from Spain!!!

Raphael M. Trautmann