PIC-based IE-Bus (AVC-LAN) interpreter

Discussion in 'The File Library' started by electricitylikesme, May 18, 2008.

  1. electricitylikesme

    electricitylikesme New Member

    Joined:
    Nov 26, 2005
    40
    0
    0
    This is my source code for the current (snooping) implementation of my PIC based IE Bus decoder.

    To hook it up you need to use Marcin's IE-Bus driver design (included).

    Use a 20mhz oscillator for the PIC16F628A, I use 33pF capacitors with it and a 120 ohm series resistor to prevent overdriving the oscillator.

    The IE Bus driver connects the AVC-Out line to Port B, Pin 0 of the PIC and AVC-In to Port B, Pin 3 of the PIC. Use a MAX-232 to connect the USART to a PC.

    The program expects to communicate at 115.2kbps, no flow control, 8 data bits, no parity and 1 stop bit.

    I'm posting this in the hopes it'll help others who want to tap the AVC-LAN and naturally it's provided 'as is' so have an idea of what you're doing before you start.

    The best information source I've found for the IE Bus and related things is Marcin's website and I developed this by carefully studying his source code (and the fact the framework has been on HDD for the last 3 years).
     

    Attached Files:

  2. Kmack

    Kmack New Member

    Joined:
    Jan 3, 2012
    15
    0
    0
    Location:
    Ontario
    Vehicle:
    2005 Prius
    Model:
    II
    BUMP!

    There certainly are a lot of open-ended posts on this, looks like there are a lot of people getting nowhere on the topic.

    For those who have expressed an intrest in learning a bit about the AVC LAN, and potentially making your own goodies or hacking some existing goodies, I have been spending a few hours doing just that. As posted in many other areas of this forum, there seems to be minimal information on what is actually going on, presumably because Toyota wants it that way.

    To that end, I have put together a snooper based on the above code and written some simple software to give a bit of a clue as to whats going on. I have spent considerable time scouring the different websites I stumbled across, and extracted as much info as I could in an effort to make heads or tails of the protocol.

    I would be happy to make available pre-programmed PIC chips and a circuit which would allow snooping, prehaps if there is enough interest, I could put together a kit or pre-assembled unit if it isn't too price prohibitive.

    Plans and software are still in the devemopement stage, but have a look at the attached picture to get an Idea of where this going.

    My goal is to get enough understanding to allow myself (and others) to do things similar to what the commercial products (like the lockpic, and others) do, or at least understand how they work. This snooper should be compatible with most Toyota products, just some of the addressing changes by model, this can be filtered out in the software later in developement.

    There is limited sample information on the internet, To continue with development, I need some more samples to analyze and help from anyone who wants to assist in "breaking the codes".

    The package is in no way comprehensive, but if you take a bit of time, you can start to see how things start to come together.

    Discussion on potential code meanings is welcome, I can post a short tutorial about what I have learned so far if anyone is interested.

    Thanks to Marcin with his informative website (link in previous post), William Rouesnel who's project this is based on, and many others who have posted snippets of info that have gone into this.

    Please let me know if there is interest in this or am I just re-iterating previous dropped projects.

    Thanks,
    Ken
     

    Attached Files:

  3. electricitylikesme

    electricitylikesme New Member

    Joined:
    Nov 26, 2005
    40
    0
    0
    How serendipitous, I've been looking at my old code just in the last few days.

    As far as I know this is all new information - personally I had a somewhat working (though hacky) car PC implementation for a while, and then have just been busy with other things.

    But I've had some renewed interest lately because my 6-CD changer has apparently just died, and I'd rather like to upgrade in a more versatile direction.

    One thing I have tried just the other night is using a much simpler IEBus driver - from this forum thread it turns out you can interface the IEBus to the microcontroller using just 4-resistors. Currently I've got one wired directly to a MAX232 to try bit-banging the control lines - if only so it's a bit easier to try things out (the PIC code suffers in that it's not trivial to handle the transmit side of things since to do it you need to cache 38 bytes of data, and do so while potentially decoding a frame as well).

    Obviously if I get an IO system working I'll post the code here.
     
  4. Kmack

    Kmack New Member

    Joined:
    Jan 3, 2012
    15
    0
    0
    Location:
    Ontario
    Vehicle:
    2005 Prius
    Model:
    II
    Just a note on the 4 resistor setup: I tried it out with a 16F628A, got it to decode no problem, Nice easy circuit for a sniffer, I just could not get it to send back to the bus. On my scope it looks like there is not enough drive and the waveform is distorted, looks like there is a capacitive component involved somehow, got curves instead of square waves no matter which way I adjusted the circuit.

    I'm going to see what else I can come up with. At this point it looks like the CAN-BUS chip might be needed for transmit.

    I'll keep you posted. In the mean time at least the sniffer only is now very few parts.

    Ken
     
  5. electricitylikesme

    electricitylikesme New Member

    Joined:
    Nov 26, 2005
    40
    0
    0
    That sounds like the PIC can't source enough current to meet the capacitance values of the bus.

    This guy solved it by using more pins (although he also has a voltage divider setup there coming straight off the +5V supply.
     
  6. Kmack

    Kmack New Member

    Joined:
    Jan 3, 2012
    15
    0
    0
    Location:
    Ontario
    Vehicle:
    2005 Prius
    Model:
    II
    Repeated below ...
     
  7. Kmack

    Kmack New Member

    Joined:
    Jan 3, 2012
    15
    0
    0
    Location:
    Ontario
    Vehicle:
    2005 Prius
    Model:
    II
    I saw that site a while back, I didn't see more pins used, I did see two pins for the comparitor and two for the output part of the circuit but maybe I missed something, I'll look again.

    I tried various combinations that were similar with no luck. After looking a bit closer at the ATMega8 datasheet, it indicates that the outputs are similar to FET drive whereas the PIC chips have what appears to be a standard TTL type output. At least it gives me something else to try, maybe if I setup a FET switching circuit on the out put it'll be enough to do it. I'm going to look at the CANBUS IC specs to see if that's what the outputs there are configured like.

    Just got to find the time to do some more work on it ...