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