Page 1 of 2 12 LastLast
Results 1 to 15 of 89

Thread: 1997 F-Body Tools

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuel Injected!
    Join Date
    Jan 2019
    Location
    Canada
    Posts
    477

    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:
    Code:
    *************************************************
    * FORWARD REQUEST TO ESIDE
    *************************************************
    
    F_REQ_ESIDE:                    ; ...
            pshy
    
    
            ldy    #$0549            ; INITIALIZE TIME OUT COUNT
            clr    COP_RFSH_COUNT        ; INITIALIZE COP REFRESH 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
    -Tom

  2. #2
    Fuel Injected!
    Join Date
    Jan 2019
    Location
    Canada
    Posts
    477
    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.


    -Tom

    =============================================
    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.

    -Tom
    Attached Files Attached Files

  3. #3
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    53
    Posts
    883
    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
    Posts
    1,475
    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
    Location
    Canada
    Posts
    477
    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....

    J1850_IF.jpg

    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 SparkFun.com. 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.

    -Tom

  6. #6
    Fuel Injected!
    Join Date
    Sep 2012
    Location
    Huntsville, AL
    Posts
    237
    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
    Posts
    1,475
    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.

  8. #8
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    53
    Posts
    883
    Quote Originally Posted by sherlock9c1 View Post
    I have an arduino uno R3 on hand; any issues with using that instead of an arduino nano? The processors are the same,
    I've yet to delve into this for lack of time, but I believe any 328P based arduino / clone will work. It looks like I'll need some zeners to test but I intend to try with a bare breadboard clone and a FTDI cable.

    Edit: one advantage to using a clone that lacks an integral usb>rs232 adapter is that the RTS line can be disconnected, eliminating the microcontroller reset caused when the serial port is opened by the client application.

  9. #9
    Fuel Injected!
    Join Date
    Jan 2019
    Location
    Canada
    Posts
    477
    Quote Originally Posted by spfautsch View Post
    I've yet to delve into this for lack of time, but I believe any 328P based arduino / clone will work. It looks like I'll need some zeners to test but I intend to try with a bare breadboard clone and a FTDI cable.

    Edit: one advantage to using a clone that lacks an integral usb>rs232 adapter is that the RTS line can be disconnected, eliminating the microcontroller reset caused when the serial port is opened by the client application.
    No zener? I just used a 9V battery in place of the zener supply for a while. The circuit is quite forgiving...

    -Tom

  10. #10
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    53
    Posts
    883
    I hadn't even looked at the schematic other than to identify you were using a transistor pair to drive the output, etc. It's hard to read, is that rail voltage 6.2 or 8.2 volts? I should have a 7806 and maybe even a 7808 3 pin regulator in my parts bin.

    Regardless, if this bus is electrically similar to the older 8192 baud ALDL, I have to wonder (and will experiment with) a simple resistor and diode arrangement as I used on my data logger.

  11. #11
    Fuel Injected!
    Join Date
    Jan 2019
    Location
    Canada
    Posts
    477
    Quote Originally Posted by spfautsch View Post
    I hadn't even looked at the schematic other than to identify you were using a transistor pair to drive the output, etc. It's hard to read, is that rail voltage 6.2 or 8.2 volts? I should have a 7806 and maybe even a 7808 3 pin regulator in my parts bin.

    Regardless, if this bus is electrically similar to the older 8192 baud ALDL, I have to wonder (and will experiment with) a simple resistor and diode arrangement as I used on my data logger.
    The objective is to send 6.25 - 8V when the output is active and high impedance when it is passive. The rest of the symbol info is in the timing of transitions. Any 8V regulator will allow for the drop in your output stage and should work a treat and you won't need a zener diode to regulate. You could avoid transistors and so on by using a 1488 rs2323 driver and a resistor. While you might not be in spec with the J1850 (rise time/fall time issues) it will work fine. When I did the circuit, I just went to my parts drawer and used what I have. Looking at it with the scope I see no problems.


    -Tom

  12. #12
    Fuel Injected!
    Join Date
    Jan 2019
    Location
    Canada
    Posts
    477
    I am posting a few things that are duplicated from the PCM thread because they belong together.

    In order to read out the FLASH content of the '97 Camaro PCM, you need to be able to access both banks of the TSide and also the Eside. I have put together a couple of command line apps that permit both TSide banks to be uploaded. I have found that GM did not implement mode $35. This mode would regularly be used as suggested by SAE J2190. The first task I undertook was to find a way to support mode $35. I did this by downloading a very small program into low memory. Using the Home Brew Cable (HBC) I first download the image to ram and execute it. This is done as follows:

    Download Mode35_T.s19 /P9194 /C3 /V00

    In this command line: Download.exe is the command, Mode35_T.s19 is the module I wish to install, /Pxxxx is the PCMs password, /C3 indicates HBC is installed on COM3 and /V00 just suppresses many of the comments placed in the code (if you want to see, try /VFF )

    Once this command is accepted by the PCM, it is ready to upload from any address in the PCM.

    I have a command line app that uses the PCM conditioned with the Mode35_T.s19 module to upload. The application is run using command line switches and generates an SRecord output file. This format is an often used way to store binary information along with addressing. It can easily be converted to a binary ( .bin file). This is done as follows:

    Upload Output.S29 /C3 /B0 /S0E00 /L0200 /V00

    In this command line: Upload .exe is the command, /C3 selects the serial port to use, /Bx selects which bank to upload (0 or 1 only), /Sxxxx sets the starting address of the upload in hex, /Lxxxx sets the length in hex, and /V00 just suppresses many of the comments placed in the code (if you want to see, try /VFF )

    I am enclosing a sample output file named TSideEEPROM.s29 along with the various executables mentioned above.

    -Tom
    Attached Files Attached Files

  13. #13
    Fuel Injected!
    Join Date
    Sep 2012
    Location
    Huntsville, AL
    Posts
    237
    Zener diode question - based on mouser, it looks like the P/N you used was 1N5344B?

  14. #14
    Fuel Injected!
    Join Date
    Jan 2019
    Location
    Canada
    Posts
    477
    Quote Originally Posted by sherlock9c1 View Post
    Zener diode question - based on mouser, it looks like the P/N you used was 1N5344B?
    The schematic should have shown the part number, but didn't... I used a 1N4738 in the prototype. You can pick up a datasheet here:
    https://www.onsemi.com/products/disc...er-diodes/1n47

  15. #15
    Fuel Injected!
    Join Date
    Sep 2012
    Location
    Huntsville, AL
    Posts
    237
    Tom, I ordered a few of those 1N5344B's before you responded; it looks like the Izt is 5x what the 1N4738's is, (150ma vs. 30ma). The Zzt is 1.5 vs. 4.5 ohms. It's been a long time since I've done circuit design; is that much more bias current a deal breaker? 150ma seems like a lot for this application.

Similar Threads

  1. 1997 F-Body ECM
    By Tom H in forum GM EFI Systems
    Replies: 508
    Last Post: 01-19-2024, 11:19 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

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
  •