View Single Post
  #190  
Old 08-22-2007, 04:13 AM
b3lha's Avatar
b3lha b3lha is offline
Phil & Belha
 
Join Date: Aug 2001
Location: Alcyone Limited, Buckinghamshire UK
Posts: 2,671
Quote:
Originally Posted by Calum
Yea, . I couldn't get to sleep Friday night and just started wandering around the internet.

Oops, I spoke too soon. The 7791 is using peripherals the 7790 doesn't have. Its got two UARTs, but its only using one. It does have the same length interrupt vector table as the 7790 though. I wonder if its just the commercial grade 7700? Ever found a datasheet or pinout of the 7791? I'll re-disassemble trying it as a 7700 and see what that coughs out.

On the port speed: it depends on how they setup the UART. Its a little old school, you can actually supply an external clock to set the speed of the UART (Nissans do that), or use the internal clock. The Subaru is a little odd. Check out the code initializing the serial port:

Code:
0094B1    AD2980        lda     al, 0x8029
0094B4    D011          bne     0x94c7
0094B6    8DCF12        sta     al, 0x12cf
0094B9    643065        ldm     #0x65, dp + 0x30                ; Write to UART tx/rx mode register
0094BC    64317F        ldm     #0x7f, dp + 0x31                ; Write to Baud rate generator
0094BF    643404        ldm     #0x04, dp + 0x34                ; Write to Control register
0094C2    643505        ldm     #0x05, dp + 0x35                ; Write to Control register high byte
0094C5    800F          bra     0x94d6

Code block address: 94C7   Length: 145  M:1 X:0 called by: 94B4
0094C7    8DCF12        sta     al, 0x12cf                      ; Branch target from 94B4
0094CA    643005        ldm     #0x05, dp + 0x30                ; Write to UART tx/rx mode register
0094CD    643133        ldm     #0x33, dp + 0x31                ; Write to Baud rate generator
0094D0    643404        ldm     #0x04, dp + 0x34                ; Write to Control register
0094D3    643505        ldm     #0x05, dp + 0x35                ; Write to Control register high byte
0094D6    643801        ldm     #0x01, dp + 0x38                ; Branch target from 94C5, Write to unknown peripheral [38]
0094D9    643907        ldm     #0x07, dp + 0x39                ; Write to unknown peripheral [39]
0094DC    643C04        ldm     #0x04, dp + 0x3c                ; Write to unknown peripheral [3C]
0094DF    643D05        ldm     #0x05, dp + 0x3d                ; Write to unknown peripheral [3D]
The unknown peripheral writes is I think a second UART. But check out how the primary UART (this is the one used for the SSM) is setup: its got two modes, depending on a variable set in the ROM-

65h - even parity, 1 stop bit, internal clock (8Mhz/2), 8 data bits, 1953.125 baud

or

05h - no parity, 1 stop bit, internal clock (8MHz/2), 8 data bits, 4807.69 baud

It looks like it can also swap between the two modes in software (it sets the UART registers later in the code), maybe. This matches the two SSM data transmission modes Kaele (Kashima) documented:

http://kaele.com/~kashima/car/gc8.html

The Japanese to English translation isn't great, but it looks like Kashima at least though about upping the speed to 9600 baud. I don't know how that would work in a car like the SVX with multiple ecus sharing the same diagnostic port. You might have to separate the engine ecu from the rest. to try it just change the line in the '65h mode:

ldm #0x7f, dp + 0x31 ; Write to Baud rate generator

to 19h istead of 7Fh. That should set it to 9600 baud instead of 1953.
I haven't been able to find a datasheet for the 37791 anywhere.

I don't think it would be an issue having the separate units on different baud rates. They stay silent until woken by their own specific read command.

At present we don't have the ability to make changes to the ROM.

As I understand it, the 28C1028 EPROM required by the ECU and TCU is no longer available. There is a guy who makes an adapter that will allow a pair of 27C512 EPROMS to be used instead. http://www.scoobyecu.co.uk. This is the same approach taken by Longassname (ECUtune) for his Stage 1.

A burner for 27C512 eproms can be found on ebay for about $18. http://search.ebay.com/Enhanced-Univ...ROM-Programmer I may think about getting one in the future, but at the moment I can't devote enough time to the project.

Phil.
__________________
Subaru ECU and TCU Website
1992 Alcyone SVX Version L
1992 Alcyone SVX Version L
1994 Alcyone SVX S40-II
2004 Subaru Legacy 2.5 SE Sports Tourer
1996 Subaru Legacy 2.2 GX Wagon
1988 Subaru Justy J12 SL-II
Reply With Quote