Introduction: Cheap OBD2 Communications on K-line (ISO 9141-2 and ISO 14230-4)

Picture of Cheap OBD2 Communications on K-line (ISO 9141-2 and ISO 14230-4)

This is just another OBD2 solution for monitoring the sensors in a verhicle. It supports the K-line OBD2 serial communication between a verhicle and a microcontroller. This K-line communication is also known as ISO 9141-2 or ISO 14230-4 (also known as Keyword Protocol 2000 or KWP). Both ISO's are almost similar. This solution differs from the rest that is low cost (for less than 10 euro!!). It is low cost in the way that you don't need an arduino, raspberry pi or smart phone. Just a microcontroller and LCD display so you can use your smartphone for other purposes.

Main features:

  • Shows verhicle engine load, temperature, speed and RPM on a LCD display
  • Optically displaying the engine load via a LED by changing the intensity using the microcontroller PWM module
  • When temperature exceeds 93 degrees a buzzer will be triggered
  • A watchdog will quard communication problems between microcontroller and verhicle ECU

To do:

  • Display stored diagnostic trouble codes in mode 0x03 (routine is included but I have to wait till my car gets troubles)
  • Clear trouble codes / Malfunction indicator lamp (MIL) / Check engine light (routine is included but untested)
  • Support "fast init"

It is tested with a Citroen C1 gasoline (2013) and VW Touran gasoline (2003). Probably it will work for a Peugeot 107 and Toyota Aygo of 2013 as well since they are technically identical. From what I read on the internet there are many flavours on K-line around so there is a possibility it will not suit your car. Maybe some changes are needed to make it work. The source code is provided so you can investigate and change when needed. Maybe you can help extending this list of cars to help others!

Have fun!



Found this site where you can check if your car supports K-line:

http://www.outilsobdfacile.com/vehicle-list-compatible-obd2/citroen

Step 1: Parts

Picture of Parts

1 x OBD2 Connector 16 Pin Male

1 x Microchip 16f886 microcontroller

1 x 16x2 LCD HD44780 or compatible

1 x BC547 or 2N3940 transistor

1 x LM7805 1A regulator

1 x 330nF ceramic capacitor

1 x 100nF ceramic capacitor

1 x 510 Ohm resistor

1 x 2.2K Ohm resistor

1 x 47K Ohm resistor

1 x 33K Ohm resistor

1 x 100 Ohm resistor, optional (for blue led, please use appropriate resistor for other colors)

1 x LED, optional

2 x 10K Ohm trim resistor

1 x Buzzer 5 volt (< 20mA), optional

Step 2: K-line Initialization and Response

Picture of K-line Initialization and Response

Both ISO's 9141 and 14230 knows a 5 baud initialization sequence. The microcontroller must start this init by transmitting byte 0x33 to the verhicle at 5 bits per second. The total transmit time for transmitting byte 0x33 takes about 2 seconds. After this initialization it is expected to continue communicating at 10k4 baud.

ISO 9141-2 initialization response:

For ISO 9141-2 the verhicle ECU will respond with synchronization byte 0x55. After this, the verhicle will respond with key bytes 0x08 and 0x08 or 0x96 and 0x96. The sync byte with key bytes of the verhicle must be acknowledged by the microcontroller by inverting the second key byte. This will end the initialization part of ISO 9141-2.

ISO 14230 initialization response:

The response of ISO 14230 is slightly different. The verhicle ECU will also respond with synchronization byte 0x55. Only the key bytes are different. In case of a VW Touran of 2003 the key bytes are 0xef and 0x8f. Also here the second key byte must be acknowledged by the microcontroller by inverting it.

Step 3: Stimulus Response

Picture of Stimulus Response

After the initialization process it is possible to submit a request to the verhicle ECU. A request is a sequence of bytes where adressing, a mode, a PID and a checksum is present. The following are example requests:

For ISO 9141-2 this sequence of bytes is 0x68, 0x6a, 0xf1, 0x01, 0x0d and 0xd1.

For ISO 14230 this sequence of bytes is 0xc2, 0x33, 0xf1, 0x01, 0x0d and 0xf4.

The first three bytes are for addressing. The fourth is the mode field. The fifth byte is the data field with the PID and the last byte is the checksum.

In this example mode 1 is used. This mode will show "current data" as how it is at this moment. This mode is perfect for displaying actual information. The data field contains the PID. In this case 0x0d which is the verhicle speed. The checksum is the sum of the bytes with mod 256. See this link for a list of PIDs:

https://en.wikipedia.org/wiki/OBD-II_PIDs

The response is almost similar. The data field reflects actual data which will probably change every request. The following are example responses with 0x00 as data (which is verhicle speed 0).

For ISO 9141-2 : 0x48, 0x6b, 0x10, 0x41, 0x0d, 0x00, 0x11.

For ISO 14230 : 0x83, 0xf1, 0x10, 0x41, 0x0d, 0x00, 0xd2.

This OBD2 solution displays the calculated engine load (PID 0x04), engine
coolant temperature (PID 0x05), verhicle speed (PID 0x0d) and engine RPM (PID 0x0c) on a LCD display.

Step 4: Schematic

Picture of Schematic

The verhicle will supply the circuit with 12 volt via pins 5 and 16 of the ODB2 connector. The voltage regulator will create 5 volt out of this for the microcontroller and LCD.

K-line signals of pin 7 will be converted to appropriate levels via an interface of resistors and a transistor.

The two trimm resistors are used to control the contrast and backlight of the LCD.

On port RC1 you can connect a LED (optional). With help of the PWM module of the microcontroller the intensity of the LED will be controlled by the calculated engine load (PID 0x04).

On port RC7 you can connect a buzzer (optional). When the engine coolant temperature (PID 0x05) exceeds the 93 degrees this port will be enabled.

Step 5: Code

The Microchip XLCD peripheral routines with some small changes are used for the external LCD module (less blurry result with fast changing data compared with other LCD routines).

A routine for displaying and clearing stored diagnostic trouble codes is included. This can be initiated by pressing the switch for 2 seconds. This routine is untested and will most probably not work. Feel free to try if you have a car with trouble codes.

The 5 baud init is also called "slow init". There is also a "fast init". The fast init does not use the 5 baud init as descibed above but starts directly at 10.4 kbps. A StartCommunication request 0xc1, 0x33, 0xf1, 0x81, 0x66 must be submitted prior submitting requests. I don't have a car which supports this fast init so maybe someone can help including it in this code to help others.

You can easily change the code if you want to have miles instead of km.

For simplicity no checksum is checked.

The code can be imported in Microchip MPLAB X IDE v3.20 with compiler XC8 v1.36. For programming the 16f886 microcontroller you need a programmer like pickit2 or pickit3.

A hex file is included in case you want to program the 16f886 with your own programming software/device.

Step 6: Have Fun

I hope you like this project. Have lots of fun building it and monitoring your verhicle!

If you are interested but not able to buid yourself just contact me. Maybe I can help with a programmed microcontroller or complete kit.

"This most beautiful system of the sun, planets and comets,
could only proceed from the counsel and dominion
of an intelligent and powerful Being."

~ Isaac Newton, Principia

Comments

phanhust (author)2017-08-09

hi bro. why is your last bit of 0x33 is low. in other document, 0x33 is send in 5 baud of speed that include 1 start-low 8 bit 0x33 and 1 stop bit- high. it 's usart frame too.

FERKOJ (author)2017-08-04

Hi, will be possible to send data from chip to Raspberry pi by i2c?

Thanks

phanhust (author)2017-07-24

hi,which software you use to see the byte transmitting and receiving ?

RichardvdK (author)phanhust2017-07-27

Hi Phanhust,

I use the debugger in the mplabx software. Here I see the received data of the mcu in an array.

Kind regards,

Richard

phanhust (author)2017-07-24

hi richard

how i can define 3 byte of car 's address?

in my case. i use for motorbike so what is different between car and motor bike??

majority of motorbike in asia also using communication on iso 9141 and iso 14230

thanks

RichardvdK (author)phanhust2017-07-27

Hi Phanhust,

The best way is to read specifications about your motorbike. Somewhere there must be described how to communicate with the ecu.

Kind regards,

Richard

VladimirN21 (author)2017-06-03

Hi,

Could i use a 16f628 chip?

milani1387 (author)VladimirN212017-06-04

no

it have low capaCITY OF flash memory

VladimirN21 (author)milani13872017-06-09

Thanks milani, today i bought 16f886 and will try it.

milani1387 (author)2017-06-02

thanks mr richard
i am sure that sagem s2000 suppurts two protocol of can and iso9141
but in this ecu i have connected to kline port....
.............
what is it the name of ecu you connected them??
...................
dear mr richard
what is it your country and city...??

RichardvdK (author)milani13872017-06-02

Hi Milani,

I use it in my Citroen C1 of 2013. I also tried VW Touran of 2003.

Richard

milani1387 (author)RichardvdK2017-06-02

What is it the name and version of your car ecu???

milani1387 (author)2017-06-02

mr richard
i am tested the sagem s2000 with elm327obd china kit
in the menu of the android aplication writed iso14230-4kwp fast
Correct you, be
it seems that protocol of my ecu iso14230-4kwp fast and not iso9141
any way..
can this source connect to iso14230-4kwp???
what is it need to change??

RichardvdK (author)milani13872017-06-02

Hi Milani,

If it is KWP 2000 fast (as described in ISO 14230-4) then you can try deleting lines 79-89, 97, 100-126 and 128-154. This will remove the 5 baud initialization sequence which is not needed when KWP 2000 fast is used. I did not test this since I don't have a car which support this protocol. Can you help me by deleting the lines and test on your ecu?

Kind regards,

Richard

milani1387 (author)RichardvdK2017-06-02

Hi mr richard..
Thanks for helping
I have accsee to some ecu with some protocol
I want developed this project and
Set fast init of kwp2000 with this circuits
I will change the code from 5 baud init to fast init of kwp2000 ... and test on my ecu....
I know that citroen xantia supoorted slow init of kwp2000
Iwant to test on this car

milani1387 (author)2017-05-31

that is logic analayzer sch
and show rx and tx channel pulse..

http://www.sharefile.ir/uploads/1496334699.jpg
..............................
dear mr richard
i am repairman of car ecu and new modern car electronic system ....
i am working on ecu for example
sagem s2000 - pl4 - sl96 ,...
valeo j35 j34
magnet marrelli ecu
siemens ecu
bosch ecu for example bosch7.3 and 5.2 and 7971
and ....................
i am sure that wiring from pic circuits to ecu is ok
i am testing all of the ecu on desk
for testing ecu i have powered up ecu and powered on key switch wire of ecu...
and connected kline of the ecu circuits...
......................
i have a professional diagnostic system for connecting to the ecu...
i have connected on desk to ecu with my diag successfully
...............
but problem is
why this circuits dont connect???
....................

i dont have access to video...
where is it???
...........................

RichardvdK (author)milani13872017-05-31

Hi Milani,

You are an expert of car ecu. According ISO 9141/14230 specifications the ecu should respond to the 5 baud initialization sequence (0x33). The ecu should respond with 0x55 at 10k4 baud. If there is no response it means that ecu is not according ISO 9141 or still an error somewhere. I read that sagem s2000 can be for Citroen C3 which can be CAN and KWP fast protocols. Can this be the problem?

Kind regards,
Richard

milani1387 made it! (author)RichardvdK2017-06-02

hi

i try and searched

this ecu protocol is kwp2000 or iso14230 fast

now question

can i change the source for this protocol??

which one of ecu supported iso9141 protocols???

are have have refrence about ecu supported protocols??

milani1387 (author)2017-05-31

hi mr richard
i am created new project in the mplab ....source code compiling is ok
but is not any diffrenc from pic16f886 and 883 ...
but the cpacity of flashmemory of the 886 is large
any way...
in the my circuit all of the wire or componet is ok
i have tested all of the componet...
and the transitor circuits for trans or reciving is ok....
i have connected pin rx and tx of micro to logic analayzer
micro send some code...
but dont recive any code from ecu....
it have send this logic bit...in rc6 port
PORTCbits.RC6 = 1;
__delay_ms(200);
PORTCbits.RC6 = 0;
__delay_ms(400);
PORTCbits.RC6 = 1;
__delay_ms(400);
PORTCbits.RC6 = 0;
__delay_ms(400);
PORTCbits.RC6 = 1;
__delay_ms(400);
PORTCbits.RC6 = 0;
RCSTAbits.SPEN = 1; //enable eusart
RCSTAbits.CREN = 1; //receive enable
WDTCONbits.SWDTEN = 1;

int iso;
while (RCIF == 0);

i have debuging the source code....when program going to while (RCIF == 0);
program rseseted and begin......Regularly repeats
and program in the while (RCIF == 0); stoped and repeated from begin of source code...
it means that micro is ok and send command code.... but not recive any code from ecu...
circuit and micro is ok
i have tested with sagem s2000 and sagem sl96 citroen and peugeot ecu
the protocol of sagem s2000 ecu is iso9141.....
i have uploaded pic of my project and logic analayzer...

http://www.sharefile.ir/uploads/1496254799.jpg

RichardvdK (author)milani13872017-05-31

Hi Milani,

I see the initialization sequence in the picture you are referring to. It looks correct but the timing is not visible. Can you check if the timing is 5 bits per second as described in step 2? Just to be sure since you are using not original program software. Also visible is the watchdog of your microcontroller since there is no response from ecu in time. So far so good. I see that you are not connecting this project to a car but to the device of the car where the ecu is located. Then you must know that ecu will only respond when the car is started (please see the video before step 1). Not sure if you can achieve this state since it is not connected to a car. Anyhow, you need to focus on ecu or circuit between microcontroller and ecu. Do you have better picture of circuit?

Kind regards,
Richard

milani1387 (author)2017-05-31

picture of seted fusebit in tnm5000 universal programmer
http://www.sharefile.ir/uploads/1496321901.jpg

picture of pulse of rx and tx pin pic16f883
http://www.sharefile.ir/uploads/1496295021.jpg
in the picture show that micro send code but not recive any code from ecu...

milani1387 (author)2017-05-29

now question is it......why buzzer songed continously???

but i dont conncet to ecu ......

it seems that micro have no action....

the circuits is ok..........doesnt have problem....

RichardvdK (author)milani13872017-05-30

Hi Milani,

What exactly makes you conclude that "micro have no action"?
Can you share your pbc? Is it possible to show how everything is connected?

Regards,

Richard

milani1387 (author)2017-05-28

hi
i made this circuits
i use pic16f883 instead of pic16f886
i have programmed hex file to micro controller with universal programmer
and in fusebit select internal rc clock
i have made this circuits...
when powerup the circuits
in lcd show "start init"
but buzzer songed continously
dont show parametr
it have conncted kline of to sagem s2000 citroen ecu with iso9141

please help me
what is it the problem????

RichardvdK (author)milani13872017-05-28

Hi Milani,

The hex file you found in step 5 is for the 16f886, not 16f883. I think the code does not fit in a 16f883 because the program memory is too small. Anyhow, I read in your comment that you managed to program the 16f883 and see "start init" on the LCD. Are you able to verify the communication between the 16f883 and ecu? You should see the same as described in step 2 and 3.

Kind regards,
Richard

RichardvdK (author)RichardvdK2017-05-28

Maybe an idea to create a new project in mplabx, import the code and compile for the 16f883 instead of 16f886. If it compiles correctly it is better to use this hex file instead of the one in step 5.

milani1387 (author)RichardvdK2017-05-29

i have changed pic16f886 to 883 in file and propertis menu of the mplab

and copmiled very successfully.

the compiler doesnt have problem and create hex file

its ok

in programmer i have write to flash memory of micro and verify successfully....

it means that code without change copied to the micro memory

........

milani1387 (author)2017-05-15

Hi
How are you
Thank you for helping
I havr added all of c file to project..
And compile it
Compiled seccessfully ...
I want to draw pcb and test circuits...
And change the pid of prarnetr
Thanks very mach.....

milani1387 (author)2017-05-13

hi

how are you mr RichardvdK

i have uploaded my mplab project...

please download ... and help me..

this link..

http://www.sharefile.ir/uploads/1494715294.rar

my erorr is :

all off the text

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/cheap obd pic/cheap obd pic.X'
make -f nbproject/Makefile-default.mk dist/default/production/cheap_obd_pic.X.production.hex
make[2]: Entering directory 'E:/cheap obd pic/cheap obd pic.X'
"D:\Program Files\Microchip\xc8\v1.42\bin\xc8.exe" --pass1 --chip=16F886 -Q -G --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -obuild/default/production/main.p1 main.c
main.c:108: warning: (373) implicit signed to unsigned conversion
main.c:220: warning: (373) implicit signed to unsigned conversion
main.c:223: warning: (373) implicit signed to unsigned conversion
main.c:227: warning: (373) implicit signed to unsigned conversion
main.c:232: warning: (373) implicit signed to unsigned conversion
main.c:260: warning: (373) implicit signed to unsigned conversion
main.c:263: warning: (373) implicit signed to unsigned conversion
main.c:290: warning: (373) implicit signed to unsigned conversion
main.c:316: warning: (373) implicit signed to unsigned conversion
main.c:319: warning: (373) implicit signed to unsigned conversion
main.c:323: warning: (373) implicit signed to unsigned conversion
main.c:328: warning: (373) implicit signed to unsigned conversion
main.c:356: warning: (373) implicit signed to unsigned conversion
main.c:359: warning: (373) implicit signed to unsigned conversion
main.c:362: warning: (359) illegal conversion between pointer types
pointer to unsigned char -> pointer to const unsigned char
main.c:407: warning: (373) implicit signed to unsigned conversion
main.c:410: warning: (373) implicit signed to unsigned conversion
main.c:411: warning: (373) implicit signed to unsigned conversion
main.c:412: warning: (373) implicit signed to unsigned conversion
main.c:413: warning: (373) implicit signed to unsigned conversion
main.c:414: warning: (373) implicit signed to unsigned conversion
main.c:416: warning: (358) illegal conversion of pointer to integer
main.c:418: warning: (358) illegal conversion of pointer to integer
main.c:420: warning: (358) illegal conversion of pointer to integer
main.c:422: warning: (358) illegal conversion of pointer to integer
main.c:424: warning: (358) illegal conversion of pointer to integer
main.c:436: warning: (359) illegal conversion between pointer types
pointer to unsigned char -> pointer to const unsigned char
main.c:487: warning: (373) implicit signed to unsigned conversion
"D:\Program Files\Microchip\xc8\v1.42\bin\xc8.exe" --chip=16F886 -G -mdist/default/production/cheap_obd_pic.X.production.map --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" --memorysummary dist/default/production/memoryfile.xml -odist/default/production/cheap_obd_pic.X.production.elf build/default/production/main.p1
Microchip MPLAB XC8 C Compiler (Free Mode) V1.42
Build date: Apr 12 2017
Part Support Version: 1.42
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

:: warning: (1273) Omniscient Code Generation not available in Free mode
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:538: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:541: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:757: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:805: warning: (359) illegal conversion between pointer types
pointer to unsigned char -> pointer to const unsigned char
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1259: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1305: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1306: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1316: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1317: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1489: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1500: warning: (373) implicit signed to unsigned conversion
D:\Program Files\Microchip\xc8\v1.42\sources\common\doprnt.c:1524: warning: (373) implicit signed to unsigned conversion
main.c:500: warning: (520) function "_DelayFor18TCY" is never called
main.c:506: warning: (520) function "_DelayPORXLCD" is never called
main.c:512: warning: (520) function "_DelayXLCD" is never called
main.c:410: warning: (759) expression generates no code
main.c:411: warning: (759) expression generates no code
main.c:412: warning: (759) expression generates no code
main.c:413: warning: (759) expression generates no code
main.c:414: warning: (759) expression generates no code
:0: error: (500) undefined symbols:
_WriteCmdXLCD(dist/default/production\cheap_obd_pic.X.production.obj) _putrsXLCD(dist/default/production\cheap_obd_pic.X.production.obj) _OpenXLCD(dist/default/production\cheap_obd_pic.X.production.obj) _BusyXLCD(dist/default/production\cheap_obd_pic.X.production.obj)
(908) exit status = 1
nbproject/Makefile-default.mk:119: recipe for target 'dist/default/production/cheap_obd_pic.X.production.hex' failed
make[2]: Leaving directory 'E:/cheap obd pic/cheap obd pic.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'E:/cheap obd pic/cheap obd pic.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/cheap_obd_pic.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 14s)

RichardvdK (author)milani13872017-05-13

Hi Milani,

You are missing the .c files or the xlcd.h file in your project hence you get errors that symbols are missing. I attached an image to this reply of how the .c and .h files must be in mplabx. Please verify.

All the best,

Richard

milani1387 (author)2017-05-10

thanks for your simple or cheap obd project
i install mplab & xc8 software.....
i want to compile or change the source code for other pid codes....
but
your code have erorss..
please uplod all of mplab project in the zip file.........
i added all of the headers and c source file to project ... but i have erorr with complieing this project............ or makeing hex file
thanks...

RichardvdK (author)milani13872017-05-10

Hi Milani,

What are the errors you get?

Regards,

Richard

milani1387 (author)RichardvdK2017-05-11

Hi
Your uplouded file is not in the mplab project pack
But
I have created mplab project and added your file in the my project....
But i have some erorr about compiling the project...
I will send to you my error...
But
Please upload all of the project in the one pack on a zip file...
Thanks
Bahram.milani

milani1387 (author)2017-05-10

hi

how are you

i want to copy c source code in ccs compiler

please help me

i have sim eror

what is it xc.h header file ???

RichardvdK (author)milani13872017-05-10

Hi Milani,

The code in this project is for MPLABX IDE with XC8 compiler where xc.h is present. Please use this compiler as described in step 5.

Kind regards,

Richard

milani1387 (author)2017-05-10

what is it the internal clock of pic micro controller???

RichardvdK (author)milani13872017-05-10

It is set to 8MHz here:

OSCCONbits.IRCF = 0b111;

BadisS made it! (author)2017-05-08

Hello Richard,

I'm having problems with my Citroën C-Elysée, it's not returning any values to my computer. I'm using Arduino Due with sn65hvd230 waveshare transceiver as shown in the picture.
Do you have an idea on what is the protocol that the C-Elysée uses and what can be causing this problem (hard and soft). Thanks in advance

RichardvdK (author)BadisS2017-05-08

Hi BadisS,

For some reason I can't find the C-Elysée in the list. Also not here:

https://www.blafusel.de/obd/obd2_scanned.php

You have a beautiful car but without information what protocol to use it will be difficult. Can someone else help BadisS with the information?

Richard

Geomeo123 (author)2017-04-28

Hi Richard, can you explain what you mean by

The sync byte with key bytes of the verhicle must be acknowledged by the microcontroller by inverting the second key byte. How does the microcontroller do this?

RichardvdK (author)Geomeo1232017-05-01

Hi Geomeo,

It is this part in the code:

TXREG = ~key2;

Here the second key byte is inverted and send to the ECU of the car.

Kind regards,
Richard

AliM155 (author)2017-01-31

HI,

what about if K-line only use 3PIN (Power, K-Line and Ground)?

in your diagram use pin 15 and 7,

please help

thx

RichardvdK (author)AliM1552017-02-08

Hi, the pins 5, 7 and 16 are used for K-line. Please see the schematic.

Take care!

mabd alfattah (author)2016-12-27

hi richard pls help me with hex file can u send to me

RichardvdK (author)mabd alfattah2016-12-28

Hi, a hex file is included now in step 5. I didn't test it so please try and feel free to reply if something is not ok.

Enjoy!

moudy_light (author)2016-12-21

please help how to write file on pic ihave pickit 2 how to convert file to. hex
or if you can give me hex file
realy want it quickly pls

RichardvdK (author)moudy_light2016-12-23

Hi,

Just press the "Build Main Project" button and the hex file will be created in the "dist" folder of your project. This hex file can be imported in your pickit2 programmer application and after setting the config bits you can put it in the microcontroller.

Take care,

Richard

moudy_light (author)RichardvdK2016-12-23

pls richardvdk give me hex file
icant creat with this program always give me error

kbudzyński (author)2016-11-02

How did you know what are the first three bytes to send to the ECU? And if someone is able to convert on the arduino? I do not have prgramator to the PIC. THX for Help.

RichardvdK (author)kbudzyński2016-11-02

Hi,

These first 3 bytes are described in the ISO 9141-2 and ISO 14230-4 documentation. These can be obtained from www.iso.org.

Have a nice day

About This Instructable

20,949views

135favorites

License:

Bio: idea + energy = instructable
More by RichardvdK:Cheap OBD2 communications on K-line (ISO 9141-2 and ISO 14230-4)
Add instructable to: