Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 51

Thread: Reverse engineering the Td5 ECU

  1. #11
    Join Date
    Jan 2013
    Location
    No Fixed Address
    Posts
    82
    Total Downloaded
    0
    Very impressive. I'm an old programmer (cobol, fortran c++) so seeing your work here I can appreciate the work you are putting in. Bloody impressive!

  2. #12
    Join Date
    Feb 2011
    Location
    Brunswick, Victoria
    Posts
    3,778
    Total Downloaded
    0
    No transformer ecu's I'm afraid.

    If anything I'd be looking at modding the obd-ii code to make more engine parameters available as PID's. But that will require a lot more investigation before I know if it's feasible.

  3. #13
    slug_burner is offline TopicToaster Gold Subscriber
    Join Date
    Jul 2007
    Location
    Melbourne
    Posts
    4,024
    Total Downloaded
    0
    Those were the days Z80, 6800, 6802, 68000. My brain still hurts.

    I love your work.
    Quote Originally Posted by benji View Post
    ........

    Maybe we're expecting too much out of what really is a smallish motor allready pushing 2 tonnes. Just because it's a v8 doesn't mean it's powerfull.

    One answer REV IT BABY REV IT!!!

  4. #14
    Join Date
    Apr 2012
    Location
    Orange, NSW
    Posts
    7,965
    Total Downloaded
    0
    Quote Originally Posted by OffTrack View Post
    No transformer ecu's I'm afraid.
    Bugger.
    "Discovery! Roll out!"
    *handbrake fails, Discovery rolls down hill ploughing into toyota*
    "Close enough"
    The Phantom - Oslo Blue 2001 Td5 SE.
    Half dead but will live again!

    Nina - Chawton White 2003 Td5 S
    Slowly being improved

    Quote Originally Posted by Judo View Post
    You worry me sometimes Muppet!!


  5. #15
    Join Date
    Feb 2011
    Location
    Brunswick, Victoria
    Posts
    3,778
    Total Downloaded
    0
    I've had a few "Ah ha!" moments over the past couple of days.

    The main one was that the software I'm using is very good at leading you up the garden path. What I've found is that the program is incorrectly displaying some instructions.

    What is being shown is:
    Code:
    lea ($05B4.W), A0
    which means "load the contents of memory location $05B4 into register A0"
    instead of
    Code:
    lea $05B4.W, A0
    which means "load the address $05B4 into register A0"

    That is a pretty big difference, and once you ignore the brackets the instruction sequences start to make sense. Once I worked out what was going on I was able to find how the the ADC module processing queues were being allocated to CPU pins which I'd been unable to find previously.

    What I'm finding is that the configuration is done in what appears to be a very convoluted way, but really makes sense if you look at it coming from the perspective of those who wrote the software.

    The firmware has three distinct sections. The base "supervisor" code which is not altered by remapping. This contains the initial CPU configuration code, memory integrity checks, and checks that variant and fuel maps match, plus a small number of functions that are common to all variants. The once the setup is done the base code reads some configuration information from the variant map and jumps to the variant map code.

    The variant map contains the vast majority of the code to manage the engine but the much of the information required to configure the CPU modules is contained in the first section of the fuel map. This might explain why map uploads failing during the initial stages of the fuel map upload were bricking the ECU so effectively.

    From the perspective of maintaining maps, this arrangement means you can make alterations to the configuration by modifying the fuel map (bearing in mind I'm talking about how the ECU operates rather than adjusting fuelling tables), rather than changing the variant map code. I've come across routines that have a check which basically says "if the value at this location in the fuel map is zero we don't need to run this code". I need to do much more work on this but it seems that diagnostic tools are reading (directly or indirectly) these bits of information to give the listing of enabled ECU functions.

    The other thing I've found is that quite a lot of code is run from interrupts, which is what you'd expect really. Certain modules will send an alert to the CPU when a process has been completed, for example when data has been received on a communications port. These alerts cause the CPU to "interrupt" what it was doing and run the code required to service the interrupt request. The first block of information in both the supervisor code and the variant map contain a table of addresses which correspond to the particular interrupt.

    cheers
    Paul

  6. #16
    Join Date
    Feb 2004
    Location
    Williams West Aust
    Posts
    20,998
    Total Downloaded
    0
    I too are a trodgolite when it comes to these matters.
    Your work makes interesting reading,keep us informed.
    Andrew
    DISCOVERY IS TO BE DISOWNED
    Midlife Crisis.Im going to get stuck into mine early and ENJOY it.
    Snow White MY14 TDV6 D4
    Alotta Fagina MY14 CAT 12M Motor Grader
    2003 Stacer 525 Sea Master Sport
    I made the 1 millionth AULRO post

  7. #17
    Join Date
    Oct 2007
    Location
    Wantabadgery, N.S.W.
    Posts
    2,742
    Total Downloaded
    0
    I'm both amazed and bamboozled. You MUST be a wizard.
    Don.

  8. #18
    Join Date
    Feb 2011
    Location
    Brunswick, Victoria
    Posts
    3,778
    Total Downloaded
    0
    Quote Originally Posted by nod 130 View Post
    I'm both amazed and bamboozled. You MUST be a wizard.
    Don.
    Unfortunately not, I'm just very persistent

  9. #19
    Join Date
    Feb 2011
    Location
    Brunswick, Victoria
    Posts
    3,778
    Total Downloaded
    0
    I should add that the "trick" to getting started is to find the location of the reset vector in the firmware. Out of reset the M68336 reads from an external chip selected by CSBOOT and with a base address of 0x000000. The documentation will tell you where to find the reset vectors.

    What you are looking for is the initial program counter. This tells the ECU address to begin executing the firmware.


    For the NNN ECU this is address highlighted in green - vector number 1 at 0x004. This tells you the start point of the code is at address 0x418, so you can begin disassembly from that point.



    cheers
    Paul
    Attached Images Attached Images

  10. #20
    Join Date
    Feb 2011
    Location
    Brunswick, Victoria
    Posts
    3,778
    Total Downloaded
    0
    I've found having a decent text covering the processor is a huge help. This book for instance gives very clear explanations of things that can be virtually impenetrable in the Motorola documentation.



    This book by Thomas Harman often appears in the "further reading" list of articles on the MC683xx processors, and is well worth hunting down if you want to dig into CPU32 based systems. I got a slightly ratty copy on abebooks for around $18 delivered.

    cheers
    Paul

Page 2 of 6 FirstFirst 1234 ... LastLast

Bookmarks

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
  •  
Search AULRO.com ONLY!
Search All the Web!