DIY CAN Bus Analyzer for Fiat Linea (Incomplete!!!Being Developed ….)

Print Friendly, PDF & Email
OBD-II Port Details
Tyco/AMP produces the in-car (female) side of the plug as part numbers 179631 or 348822, and both use the same pins, either P/N 776001 or 1827012. Molex has a similar offering; the pins are P/N 50420, and the housings are 51115 (with a 51117 retainer) and 51116 (with a 51118 retainer). Delphi/Packard’s part numbers are 11210250 for the housing and 12129373, 12129484, 13525297, and 15317769 for the pins (female Metri-Pack 150).
The client-side connection is pretty ubiquitous. The Molex P/Ns are 57964 for the pins, and 68503 for the housing. Delphi shows 12110252 as the P/N for the housing, and 12040993, 12047581, 12059894, 12092165, 12110502, 12160811, 15305307, or 15326725 for the pins (male Metri-Pack 150), depending on the size you need.
OBD-II Port Details
image
CAN Bus Location in Fiat Linea
image
image
image

Interface Board

USB Can Board

Test Setup

Hardware:- 18F4550 , MCP2551 , MCP2515, 2x20MHz Crystals, 220nf Cap, 4x10KOhms, Headers

Development :  CCS Compiler, MPLAB IDE, PICKIT3 Programmer and Debugger, USB-RS232 FTDI Breakout Board

Loopback Test Program to verify especially MCP2515 CAN Trans-receiver (RS232 MODE)

Connection Matrix as follows

PIC18F4550

MCP2515

PIN NO 27 (D4) SPP4

PIN NO (16) CS

PIN NO 33  (B0) SDI

PIN NO (15)SO

PIN NO 26 (C7) SDO

PIN NO (14)SI

PIN NO 34 (B1) SCK

PIN NO (13)CLK

PIN NO 16(C1) CCP2

PIN NO (12)INT

 

Code Sample:

#include 
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
#use rs232(baud=9600, xmit=PIN_E1,rcv=PIN_E2)
//not used only for diagnostic
#define LED PIN_D1
// These connections are for the Microchip MCP2510 Dev. board
#define EXT_CAN_CS PIN_D4
#define EXT_CAN_SO PIN_B0
#define EXT_CAN_SI PIN_C7
#define EXT_CAN_SCK PIN_B1

#include

void main(void)
{
int32 can_id;
int can_data[8];
int can_length, counter;
struct rx_stat rxstat;

puts("Can Sample");

can_init();
puts("Can init done");

can_set_mode(CAN_OP_LOOPBACK);
puts("Loopback mode set");

counter = 0;
puts("Starting");

can_data[0] = 0x55;

while(1)
{
if(kbhit())
{
getch();

if(can_putd(42, can_data, 1, 3, TRUE, FALSE))
puts("tx ok");

while(!can_kbhit());

if(can_getd(can_id, &can;_data[0], can_length, rxstat))
puts("rx ok");

counter++;
}
}

}

Loopback Test Program to verify especially MCP2515 CAN Trans-receiver (USB CDC)

#include 
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
#use rs232(baud=9600, xmit=PIN_D1,rcv=PIN_E2)
//not used only for diagnostic
#define LED PIN_D1
// These connections are for the Microchip MCP2510 Dev. board
#define EXT_CAN_CS PIN_D4
#define EXT_CAN_SO PIN_B0
#define EXT_CAN_SI PIN_C7
#define EXT_CAN_SCK PIN_B1

#include
#include

void main(void)
{
char c;
int32 can_id;
int can_data[8];
int can_length, counter;
struct rx_stat rxstat;

puts("Can Sample");

can_init();
puts("Can init done");

can_set_mode(CAN_OP_LOOPBACK);
puts("Loopback mode set");

counter = 0;
puts("Starting");

can_data[0] = 0x55;
usb_init_cs();
while(1)
{
usb_task();

if(usb_cdc_kbhit())
{
c=usb_cdc_getc();

if(can_putd(42, can_data, 1, 3, TRUE, FALSE))
printf(usb_cdc_putc,"tx ok");

while(!can_kbhit());

if(can_getd(can_id, &can;_data[0], can_length, rxstat))
printf(usb_cdc_putc,"rx ok");

counter++;
}
}

}
Ishan Karve

About Ishan Karve

Ishan Karve is just an every day normal guy next door who happens to be an Electronics Engineer by profession and dabbles with PHP, Javascript, C++ and python. His interests vary as seasons change.. they change from astronomy to soul searching. This site is just a reflection of what he does to keep his mind engaged when he is not occupied by work and family. He is an extremely objective guy and is always ready for some good arguments.. of course over a glass of 40% proof alcohol.
This entry was posted in CCS C, DIY, Electronics, PIC, Programming and tagged . Bookmark the permalink.

4 Responses to DIY CAN Bus Analyzer for Fiat Linea (Incomplete!!!Being Developed ….)

  1. fco says:

    Hi!
    Molex part number 68503 for the housing seems to be wrong.
    Keep the good work up!

  2. Viny says:

    Hi,

    Its nice to see you working on CANBUS for Linea.
    I also have linea and have been trying to capture and control some of the functions in Linea via pc. I am using ELM 327 and capturing data from CANBUS. I need some help in identifying the set of instructions thats been share for a given action performed. Canbus log gives 100s of lines of data and need to map data against the action. Can you help in doing that.

    Thanks
    Viny

  3. R.S.SUNDARAM says:

    Dear Mr.Ishan Karve,

    I R.Saravana Sundaram from Salem, Tamilnadu, basically I am a Diploma Electronic Engineer I completed my diploma in 1988. Now I want to learn Embedded C programing using CCs PICC Complier. I know little bit knowledge about CCS C Compiler. I can do small project by using individual peripheral but i am not able to do a real time application projects. I requesting you to train me over online if possible to do myself any kind of project using pic controllers. I tried with many persons by online no one is interested to guide me to learn completely. Please once again I am requesting you to help me to develop myself an embedded engineer if possible. Please reply me and expecting your support.

    Thanks with Best Regards
    R.S.Sundaram

Leave a Reply

Your email address will not be published. Required fields are marked *