Results 1 to 6 of 6

Thread: DIY OBD II Interface

  1. #1
    Newbie
    Join Date
    Feb 2010
    Posts
    2

    DIY OBD II Interface

    My goal is to read some basic OBD II information. I am using a PIC 18F2585 c/w CAN module, connected to MCP 2551, then attached to the CAN HI/LO pins on the OBD II connector on Toyota Sienna 2005.

    When I connect my circuit, I see (lots of) messages, so I'm reasonably comfortable that I am receiving CAN messages. So, next I try to transmit a request for OBD II info, as follows:

    // ECAN port vars
    unsigned long id = 0;
    BYTE txdata[8];
    BYTE txlen = 0;

    id = 0x7DF; // Functional address
    txdata[0] = 0x02; // PCI ProtoCol Information; two data (within 8 byte CAN/OBD payload)
    txdata[1] = 0x01; // OBD mode 01 == get PID
    txdata[2] = 0x00; // PID 00 == bit map of supported PIDs from 0 thru 20
    txdata[3] = 0x55; // avoid 0's to minimize bit stuffing
    txdata[4] = 0x55;
    txdata[5] = 0x55;
    txdata[6] = 0x55;
    txdata[7] = 0x55;
    txlen = 0x08;
    vs = ECANSendMessage(id, txdata, txlen, (ECAN_TX_STD_FRAME | ECAN_TX_PRIORITY_0));


    The ECANSendMessage function returns SUCCESS. I expected to receive some messages from devices in address range 0x07** but I don't get anything other than this (over and over):
    CAN RX ID: 0020 Flags: 00 Data: 00 00 07
    CAN RX ID: 0025 Flags: 00 Data: 0F 91 0F 8D 75 75 75 C8
    CAN RX ID: 0023 Flags: 00 Data: 02 00 01 FD 00 00 2A
    and a few recurring messages like this:
    CAN RX ID: 04C6 Flags: 00 Data: 07 00 01 00 00 00 00 00
    CAN RX ID: 0423 Flags: 00 Data: 00
    CAN RX ID: 04C3 Flags: 00 Data: 03 00 01 00 00 00 00 00
    CAN RX ID: 04C7 Flags: 00 Data: 08 00 01 00 00 00 00 00

    So, here are a few questions:
    Is there anything in CAN that is equivalent to a PING? i.e. a query that 'should' be answered?
    What are the usual debugging techniques when trying establish communications to a device?

    Thanks,
    Jake

  2. #2
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    Thread moved to OBDII forum for increased visibility.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  3. #3
    VENDOR - ScanTool Vitaliy's Avatar
    Join Date
    Dec 2006
    Location
    Phoenix, AZ
    Posts
    624
    Jake,

    Does your Sienna have pins 7 (and maybe 15) populated?

    Vitaliy
    OBDLink MX: world's smallest, fastest, most advanced OBD/Bluetooth adapter with SW and MS CAN support. Read the review to learn more.
    Need to look up a diagnostic trouble code? Try the most up-to-date, free DTCsearch.com!

    You cannot send me a private message using this forum. Use my email instead: vitaliy[@]scantool.net.

  4. #4
    Newbie
    Join Date
    Feb 2010
    Posts
    2
    I tried laying on the floor under the steering column; but my eyes won't focus at that short distance, so I can't tell for sure what pins are there. I also tried taking a picture with the wife's digital camera, but even on 'macro' the distance is so short that the flash overpowers the image.

    Meanwhile, I know for certain that pins 6 and 14 are live - because I am receiving CAN messages.

    Also, based on info on other web sites, I suspect that pin 7 is connected. Are you suggesting that I switch from CAN to ISO 9141?

    Jake

    Edit: I attached a cable with pigtails, connected to the OBD-II plug, and measured voltage on both pins 7 & 15; so the answer is yes.

  5. #5
    Constant Bitrate
    Join Date
    Jan 2010
    Posts
    130
    Quote Originally Posted by eejake52 View Post
    Is there anything in CAN that is equivalent to a PING? i.e. a query that 'should' be answered?
    What are the usual debugging techniques when trying establish communications to a device?
    You're asking it, mode 1, pid 0 is mandatory. It think that the point of the question above is that just because the vehicle has a CAN bus doesn't mean that it supports OBD-II over it. That was not a regulatory requirement in the US until basically '08.

    Pin 7, mentioned above, is the K line, used in the common ISO 9141/KWP2000 protocols, common in EU and Japanese vehicles. However, just because it is there doesn't automatically mean that CAN is not OBD-II supported.

    Sometimes the older protocol lines are left in place for dealer diagnostic tools. For example, my daughter's '06 Saturn supports OBD-II over CAN, but also has J1850 lines, which only respond to GMLAN commands.

    Something you could try is connecting a scan tool (some auto places will do it for free) and seeing what protocol is reported. The vehicle will generally only support one.

    On the CAN side, you are asking for a mandatory PID, but you are generally supposed to ask for it four different ways. 250Kbit std (11 bit addressing), 250Kbit ext. (29 bit addressing), 500Kbit std, 500 Kbit ext.

    It *looks* like you are seeing legitimate vehicle traffic, but it can be deceiving. That is, just because you are seeing 11 bit addressing on broadcast messages doesn't mean that 29 bit addressing is not used for OBD-II (though it isn't very common). Both can exist on the same bus, but a vehicle is, by regulation, only supposed to respond to OBD-II one way or the other.

    Good Luck
    -jjf

  6. #6
    VENDOR - ScanTool Vitaliy's Avatar
    Join Date
    Dec 2006
    Location
    Phoenix, AZ
    Posts
    624
    Jake,

    What Joe said.

    I would either buy or "rent" an OBD interface, and find out for sure which protocol the car is using. Since you're doing embedded development, I'm sure your time is far from free.

    The good news is, the ISO protocols are very simple. You can bitbang the pins, or use a 2nd UART if you want to cut down on your programming workload. The bad news is, ISO is at least ten times slower than CAN.

    Vitaliy
    OBDLink MX: world's smallest, fastest, most advanced OBD/Bluetooth adapter with SW and MS CAN support. Read the review to learn more.
    Need to look up a diagnostic trouble code? Try the most up-to-date, free DTCsearch.com!

    You cannot send me a private message using this forum. Use my email instead: vitaliy[@]scantool.net.

Similar Threads

  1. Core Duo / Core 2 Duo Mini-ITX boards
    By RedGTiVR6 in forum General Hardware Discussion
    Replies: 153
    Last Post: 10-03-2010, 10:30 PM
  2. ELM327 VS. OBD Diagnostic Interface..need advice!
    By qewani in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 13
    Last Post: 01-29-2009, 04:43 PM
  3. Confused about OBD II
    By tom2112 in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 30
    Last Post: 10-19-2007, 01:06 AM
  4. Indexing music in 1.0.9.8 Failed
    By hovalistic in forum StreetDeck
    Replies: 0
    Last Post: 07-07-2007, 11:19 AM
  5. OBD II thoughts
    By midiwall in forum Centrafuse
    Replies: 1
    Last Post: 03-12-2007, 12:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •