Results 1 to 7 of 7

Thread: 1997 F-Body Tools

  1. #1
    Fuel Injected!
    Join Date
    Jan 2019

    1997 F-Body Tools

    New thread is intended to help support tools of use for debugging, uploading and downloading LT1 OBDII PCMs.

    I have had a good look now at some software that I believe Tech II uses to download these PCMs. Somewhere back in the 1997 F-Body PCM thread there are details of this software but I have had a much deeper dive into it now and it's worth sharing. I believe that in our PCMs the TPU is the heart of the system. If you accept that I will offer that the SPI bus is the backbone. In working through the way that the Eside is programmed, I came to a better understanding of how the SPI is used in the system.

    During normal operation, the SPI makes our multi-processor system function by transferring data both from Tside to Eside while simultaneously transferring from Eside to Tside. Details of this transfer are to be found in the "PCM" thread and I will not duplicate here other than a broad overview. The T to E transfer moves 25 parameters every cycle along with a checksum. The E to T moves 20 parameters each cycle plus one of eight frames and of course checksum. The eight frames each have 10 parameters and are sent sequentially every cycle. So it is the SPI that passes both control and information between the two sides.
    A second function present during normal operation is the monitoring of the output driver circuits. Here, the Tside re-configures the SPI, de-asserts slave select to the Eside and transfers two bytes through the blue, red and black driver ICs. Those ICs are the 23 pin staggered SIPs that are found by each of these connectors.
    The third function the SPI serves relates to upload/download. The Tside sends an SPI message that puts Eside into a special mode. In this mode the Eside interprets commands sent to it in a very similar way that DLC commands are interpreted. In fact these commands are the same except that the header used in J1850 is stripped off.

    With that background, one goal I have is to upload the code from Eside. This will make use of a mode $35 command. While the Tside does not support mode $35, I wrote some software to provide it. This permits upload of Tside. To do the same with Eside the command received and validated by the Tside must then be forwarded through the SPI and acted on by the Eside.

    I have improved the comments in the programming assembly file and will attach a snip of it to this post. In order to support upload, I will re-write some of this code to permit validation and forwarding of mode $35 commands to the Eside. I plan to merge the software I wrote earlier such that uploading will require a single file downloaded to the Tside. Once downloaded the module will permit uploading from both banks of Tside and from Eside.

    Here is a snip of the code that does the forwarding in the download case:
    F_REQ_ESIDE:                    ; ...
            ldy    #$0549            ; INITIALIZE TIME OUT COUNT
            jsr    RESET_COPS        ; RESET    COP TIMERS
    FE_WAIT_ES:                    ; ...
            dec    COP_RFSH_COUNT        ; DECREMENT COP    REFRESH    COUNT
            bne    FE_SKIP_CR        ; SKIP COP RESET
            jsr    RESET_COPS        ; RESET    COP TIMERS
            dey                ; DECREMENT TIME OUT COUNT
            beq    FE_FAULT        ; TIME OUT EXPIRED
    FE_SKIP_CR:                    ; ...
            ldaa    PORTA            ; PORT A BIT 1
            anda    #$02
            bne    FE_WAIT_ES        ; LOOP UNTIL ESIDE SIGNAL
            ldaa    $00,x            ; READ SPI TX DATA
            staa    SPDR            ; INITIATE FRAME TRANSFER
    FE_XFER_LP:                    ; ...
            ldaa    SPSR            ; READ THE SPI STATUS
            bpl    FE_XFER_LP        ; WAIT FOR TRANSFER TO COMPLETE
            ldaa    SPDR            ; READ SPI RX DATA
            cba                ; COMPARE RECEIVED WITH    BYTE COUNT
            bne    FE_FAULT        ; SPI FRAME ERROR
            incb                ; INCREMENT TRANSFER COUNT
            inx                ; INCREMENT SPI    TX BUFFER POINTER
            puly                ; RESTORE REGISTER
            rts                ; DONE
    ; ---------------------------------------------------------------------------
    FE_FAULT:                    ; ...
            ldx    #$1008            ; SLAVE    SELECT INACTIVE
            bset    $00,x $20        ; ABORT    REQUEST    TRANSFER
            jmp    START
    ; End of function F_REQ_ESIDE

  2. #2
    Fuel Injected!
    Join Date
    Jan 2019
    Home brew cable update

    There were a number of bugs in the first version of the home brew cable. A time parameter was mistakenly entered in hex instead of decimal. The cable had only been hand tested and had never been checked for ensuring the tx didn't over write incoming frames. Other small fixes.

    Thought I would take just a moment to update the software in case someone is trying this... There is no change to the interface, so I just copied the info from the other thread here.


    Download for OBDII

    The first bit of software to discuss is the bit that runs the home brew cable (HBC). The heart of the HBC is an Atmel ATMEGA328P processor. Subjectively, this part has a lot of advantages over the 68HC11 that I first tested with. The timer has very powerful modes, the free IDE programs the part in C and has all you need to write/debug code. Cost of the board was under $5 although the worldwide shortage of semiconductor parts has brought the price up a bit.

    My code which Atmel refers to as a "sketch" is written in 5 modules. Here is the basics of operation:

    The HBC software separates receive and transmit completely. This lets me monitor what I send along with what is returned by other nodes. The software (at least this version) has limitations in speed (no 4X yet) and in ability to perform outside of the early GM network (no arbitration --> two nodes only, break is detected but not acted on)

    The receive symbols are decoded using the pin change interrupt. The interrupt determines the level of the previous bit and it's length. It then looks up the meaning of the symbol and pack it into bytes sent to the PC.

    The transmit is timer driven. When a line is received, it waits until any current frame in progress is complete, then output the frame including SOF and EOF.

    A normal sequence to read the security seed sends
    4C 10 F0 27 01 71
    and receives
    4C F0 10 67 01 58 3D 27

    Since the Arduino Nano board uses serial over USB, I set the interface at 115200 8N1
    Characters are sent to the board using standard ASCII, each pair represents a hex digit

    Probably forgot to detail something, so please just ask if there is confusion.

    I am enclosing an archive of the Atmel archive. I am told that it is just a zip file that contains the project. All is in public domain/free for you to use. I expect to be improving on features and quality as time passes, will post later versions here.

    That is the cable software, but I have written command line code for your PC that takes SRecords and downloads them to ram. All sorts of things can be downloaded: Flash programming, Flash dumping, debug routines... whatever you can think of.

    Attached Files Attached Files

  3. #3
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Interesting stuff Tom. I recently bought a 2001 Y body and was thinking to myself how cool it would be to have an open source tool to talk to it with. But for now I'll be dusting off my Jet cable / software (based on tunercat).

    Just to clarify a few bits - the arduino IDE is not sanctioned by Atmel. They also have a free but non-open IDE suite for their AVR products but it's not quite as friendly to beginners.

  4. #4
    Fuel Injected!
    Join Date
    Mar 2013
    Quote Originally Posted by spfautsch View Post
    Interesting stuff Tom. I recently bought a 2001 Y body and was thinking to myself how cool it would be to have an open source tool to talk to it with. But for now I'll be dusting off my Jet cable / software (based on tunercat).

    Just to clarify a few bits - the arduino IDE is not sanctioned by Atmel. They also have a free but non-open IDE suite for their AVR products but it's not quite as friendly to beginners.
    A little off topic but 2001 ybody pcm is currently very well hacked, with freeware support. Still a homebrew cheap cable is missing, but you can easily fill the gap.
    Maybe a new thread will be more appropriate to get you started.

    On topic, the progress is awesome. Great work and complete write up. Can`t wait to see that project finished.

  5. #5
    Fuel Injected!
    Join Date
    Jan 2019
    I received mail with a few questions regarding the home brew J1850 cable. For this project I have built a single prototype and the software is still somewhat in flux. Having said that, it works reliably and I have been looking at extending the upload capability to the Eside. I am answering questions on this thread because whatever someone finds unclear, others will surely question as well. OK so....


    1) The 820 Ohm Resistor; is that a commonly available discrete or should I combine a few resistors to get that value?
    This resistor was selected based on several assumptions. The zener diode is 8.2V and for my test setup the input voltage is 12V (give or take). These two components are just there to provide an 8.2V source for the line driver. There should be round about 4v across the resistor. This gives us about 5ma of bias current for the zener. Since IZT of the zener is 30ma you could go with a much smaller resistance but not too much larger. Probably 1K would be fine. Just depends on what you have floating around your tool box. I suggest you use no larger than 1K or smaller than 500 ohms. With these values resistor of 1/10 watt will be fine. This part is not sensitive... use what you got.

    2) Best to get the 47K resistor in the bulk pack kit?
    The 47K resistor forms a voltage divisor with the 10K. The ratio of these two parts is important but values could be changes. These two resistors along with the transistor and another 10K form an inverter and a level shifter/buffer. Test your circuit by sending frames. You should see the output of this inverter toggle and the circuit will send your sent frame such that you can monitor it for correctness on your terminal. These resistor are all available on digi-key/Amazon/Ebay and hundreds of places.

    3) The Arduino_Nano... there's a lot of choices on Any recommendations in particular? I see this one: Arduino Nano Every - DEV-15590 - SparkFun Electronics
    I bought several Arduino boards. I like the ones that come with a short cable and have all the header pins installed. I can't recommend a vendor except to say that some things are in short supply just now. I got mine through Amazon and found a vendor that had a good delivery and good recommendations from other buyers.

    4) Any particular size breadboard you recommend?
    I guess it depends on your skill soldering and so on. If you want small, surface mount resistors are good. you can use wirewrap wire to hook things up. With leaded components you will be a bit larger due to the resistor wires and bending them to fit the holes. I would thing 2" by 4" would be more than enough. So far I have not built a breadboard. I built mine in a prototyping strip... this is just another project I need to complete.

    Hope this helps.


  6. #6
    Fuel Injected!
    Join Date
    Sep 2012
    Huntsville, AL
    I have an arduino uno R3 on hand; any issues with using that instead of an arduino nano? The processors are the same, I believe the code is the same, and we only need two output pins so we should be good? I'm just brand new to arduinos.

  7. #7
    Fuel Injected!
    Join Date
    Mar 2013
    Great write up on the hardware side.

    Can you give some insight how the software side of actual communication will work. Does it use comm port, is it transparent or some translation between cable and pcm is done, checksum and so on. The usual stuff we need to get a good start with it.

Similar Threads

  1. 1997 F-Body ECM
    By Tom H in forum GM EFI Systems
    Replies: 434
    Last Post: 1 Week Ago, 11:29 PM
  2. Tools are good...
    By DavidBraley in forum GM EFI Systems
    Replies: 2
    Last Post: 12-05-2016, 05:46 AM
  3. 95 F-body Fuel Pump with 95 B-Body Engine/Tank
    By EPS3 in forum GM EFI Systems
    Replies: 7
    Last Post: 09-19-2016, 02:40 PM
  4. PRE efi tools
    By roughneck427 in forum Fuel Injection Writeups Articles and How to New and Old
    Replies: 1
    Last Post: 03-12-2015, 07:17 PM
  5. Good PCM Hacking Tools For OSX
    By Durahax in forum TunerPro Tuning Talk
    Replies: 0
    Last Post: 07-28-2013, 12:58 AM


Posting Permissions

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