Nissan ECU Tuning Forum Index Nissan ECU Tuning
Welcome to Nissan ECU Tuning
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Home | Forum

How close are Nissan's registers to std. 63b03?
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Nissan ECU Tuning Forum Index -> 300zx Chip Tuning
View previous topic :: View next topic  
Author Message
StinkyZ



Joined: 10 Dec 2003
Posts: 111
Karma: 0 (0)

Location: Tampa, Fl

PostPosted: Fri Dec 09, 2005 2:55 pm    Post subject: Reply with quote

Sorry to interupt again. Could one of you guys do me a quick favor and comment each line of code to give me an idea of what I'm looking at? Also, you mentioned the Q45 ecu. Is is as programmable as the z32 ecu? Very similiar I assume?

"
B8F7 : B6 14 08 " " ldaa current_speed
B8FA : F6 FF C8 " " ldab 5th_gear_switchover
B8FD : 3D "=" mul
B8FE : 04 " " lsrd
B8FF : 04 " " lsrd
B900 : 04 " " lsrd
B901 : 18 " " xgdx
B902 : BC 14 0B " " cpx CAS_signal
B905 : 25 0A "% " bcs LB911
B907 : 7B 04 5E "{ ^" tim #$04input_reg_5E
B90A : 26 05 "& " bne LB911
B90C : 72 80 5E "r ^" oim #$80input_reg_5E
B90F : 20 03 " " bra LB914
"
Back to top
View user's profile Send private message AIM Address
rybowen



Joined: 08 Sep 2005
Posts: 118
Karma: 0 (0)


PostPosted: Fri Dec 09, 2005 7:40 pm    Post subject: Reply with quote

B8F7 : B6 14 08 " " ldaa current_speed; load RAM address containing current veh. speed in kph into register A
B8FA : F6 FF C8 " " ldab 5th_gear_switchover; load data at ROM location 7FC8 (5th gear switchover X factor) into register B
B8FD : 3D "=" mul; multiply reg A and B, store 16-bit result in AB
B8FE : 04 " " lsrd; divide AB by two
B8FF : 04 " " lsrd; divide AB by two (now 1/4)
B900 : 04 " " lsrd; divide AB by two (now 1/8 )
B901 : 18 " " xgdx; exchange reg AB with index reg
B902 : BC 14 0B " " cpx CAS_signal; compare index reg to current RPM/12.5 (CAS signal)
B905 : 25 0A "% " bcs LB911; if less than, advance program counter 10 bytes (to location B911)
B907 : 7B 04 5E "{ ^" tim #$04input_reg_5E; otherwise test bit 2 of RAM address 005E (this is the bit used to indicate that we're in Park or Neutral)
B90A : 26 05 "& " bne LB911; if it is NOT 0, advance prog counter 5 bytes (to location B911)
B90C : 72 80 5E "r ^" oim #$80input_reg_5E; otherwise OR bit 7 RAM location 005E
B90F : 20 03 " " bra LB914; always branch to B914

So it's doing the following: High gear = ((speed in kph*7FC8)/8 ) >= (rpm/12.5)

And the Q45 code base is 90% similar to the 300zx as far as I can tell. Most of the RAM addresses are different.
Back to top
View user's profile Send private message
StinkyZ



Joined: 10 Dec 2003
Posts: 111
Karma: 0 (0)

Location: Tampa, Fl

PostPosted: Fri Dec 09, 2005 9:13 pm    Post subject: Reply with quote

Awesome. Thank you. I guess it's not too bad once you have a good understanding of how the code works with registers and such. I've done java and c++ before but they are obviously a bit easier.

Before I get too into this...Do you think learning to read, disassemble, and reassemble the stock code is something that can be learned in my spare time? Or is it something that takes years to get the hang of?

How many lines of code are there total? If you have the disassembly is it pretty easy to track down things like the K constant and how they are used? My guess is that mapping out all the functions of the ecu would take quite a bit of time?
Back to top
View user's profile Send private message AIM Address
rybowen



Joined: 08 Sep 2005
Posts: 118
Karma: 0 (0)


PostPosted: Sat Dec 10, 2005 1:43 am    Post subject: Reply with quote

There's a lot of code there, but it's not hard to learn. THe last time looked ad assembly was 1991, and it didn't take me long to get the hang of it again. Just start working on one corner of it, and eventually it will come unravelled like a big knot...
Back to top
View user's profile Send private message
weingart



Joined: 03 Dec 2003
Posts: 11
Karma: 0 (0)

Location: Edmonton, AB

PostPosted: Tue Dec 20, 2005 8:06 pm    Post subject: Reply with quote

[quote:44493bd801="StinkyZ"]
Before I get too into this...Do you think learning to read, disassemble, and reassemble the stock code is something that can be learned in my spare time? Or is it something that takes years to get the hang of?
[/quote:44493bd801]

Well, to really get the hang of it, you pretty much should have done some
coding in it. It helps in getting to know the various tricks of the trade (so
to speak). It helps in recognizing a devision routine, as well as other things.
Having said that... all of this is "spare time". If you think you will have a full
understanding of the Z32 ECU (or any 8-bit computer slightly more trivial
than a calculator) in the next couple weeks, you'd be mistaken...

[quote:44493bd801="StinkyZ"]
How many lines of code are there total? If you have the disassembly is it pretty easy to track down things like the K constant and how they are used? My guess is that mapping out all the functions of the ecu would take quite a bit of time?
[/quote:44493bd801]

Well, there are quite a few. Some used, others not. I dont have access
to my laptop right now, but I seem to remember it's in the 10'000 lines
worth of commented code + interpreted data. Along with annotated ports,
I/O registers to the UPP, etc.

--Toby.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ITALIANZ



Joined: 07 Jul 2005
Posts: 24
Karma: 0 (0)


PostPosted: Thu Dec 29, 2005 10:37 am    Post subject: Reply with quote

Hello guys, I found this discussion really interesting.
Do you know how the analog inputs are handled by the Z32 ECU ? Are they converted by some external chip and then mapped into memory registers ?
Is there some analog input not used ? The idea would be connecting additional sensors and then read their value through the Conzult.
Thanks for your great work.
Happy new year to everybody.
Back to top
View user's profile Send private message
rybowen



Joined: 08 Sep 2005
Posts: 118
Karma: 0 (0)


PostPosted: Fri Dec 30, 2005 10:19 pm    Post subject: Reply with quote

There is at least one "extra" analog input that I can think of - EGR temperature sensor. It is used in ECUs destined for the California market. 0-5 volts. It would be pretty easy to configure it for another use.
Back to top
View user's profile Send private message
darkhalf



Joined: 08 Dec 2003
Posts: 379
Karma: 0 (0)

Location: Adelaide, Australia

PostPosted: Fri Jan 06, 2006 3:50 pm    Post subject: 6303XP registers update Reply with quote

first post in this thread table appears incomplete.... following i did tonight ....is directly from 6303XP datasheet as im going through my CR31 TCU code trying to find maps of some sort (they appear 16 bit)

; HD6303XP (DIP)
; 192 bytes RAM (0x00-0x1F registers)
cpu 6303

; Chip from E000-FFFF (Size 2000 = 8KB = 8bitsx8kByte=64kbits)
org 0xE000
code 0xFE00 start

symbol 0x0001 Port1_DDR
symbol 0x0003 Port1
symbol 0x0008 Timer_control_status1
symbol 0x0009 FreeRunningCounterMSB
symbol 0x000A FreeRunningCounterLSB
symbol 0x000B OutputCompareRegMSB
symbol 0x000C OutputCompareRegLSB
symbol 0x000D InputCaptureRegMSB
symbol 0x000E InputCaptureRegLSB
symbol 0x000F Timer_control_status2
symbol 0x0010 Rate_control
symbol 0x0011 TxRx_control_status
symbol 0x0012 RxDataReg
symbol 0x0013 TxDataReg
symbol 0x0014 RAM_Port5_control
symbol 0x0015 Port5
symbol 0x0016 Port6_DDR
symbol 0x0017 Port6
symbol 0x0019 OutputCompareReg2MSB
symbol 0x001A OutputCompareReg2LSB
symbol 0x001B Timer_control_status3
symbol 0x001C TimeConstantRegister
symbol 0x001D Timer2UpCounter
symbol 0x001E RegRAM
symbol 0x001F RegTestOnly

; Reset and interrupt vectors

vector 0xFFFE RES_vector RESET_entry
vector 0xFFEE TRAP_vector TRAP_entry
vector 0xFFFC NMI_vector NMI_entry
vector 0xFFFA SWI_vector SWI_entry
vector 0xFFF8 IRQ1_vector IRQ1_entry
vector 0xFFF6 ICItmr_vector ICItmr_entry
vector 0xFFF4 OCItmr_vector OCItmr_entry
vector 0xFFF2 TOItmr_vector TOItmr_entry
vector 0xFFEC CMItmr_vector CMItmr_entry
vector 0xFFEA IRQ2_vector IRQ2_entry
vector 0xFFF0 SIO_vector SIO_entry
Back to top
View user's profile Send private message Visit poster's website
rybowen



Joined: 08 Sep 2005
Posts: 118
Karma: 0 (0)


PostPosted: Fri Jan 06, 2006 10:05 pm    Post subject: Reply with quote

Yes, I have a newer and much longer version, that mostly matches yours. Unfortunately I'm the only person that I know of doing G50 stuff, so it is not really useful for anyone else.

I've since gone to IDA pro - have you tried that?
Back to top
View user's profile Send private message
RomChip200



Joined: 27 Nov 2003
Posts: 203
Karma: 0 (0)

Location: France

PostPosted: Thu Sep 20, 2012 9:25 am    Post subject: Reply with quote

Hi all,

Makes a long time.

I need to save my time Very Happy

I'm going to connect some additionnal sensors to the HD63140 (300zx ECU) so I need to know which I/O are free, typically to sample an input square wave frequency.
I already have the allocation of the A/D channels but I/O pulse generator/sampling is a bit more fuzzy and the datasheet takes some time to decipher. Particularly the commands of the pulse gen.

So, do people have I/O pins allocation or any detail, typically the 63140 wiring schematic or xls file ?

Purpose is to put my 300zx at the state of the art, making it fully flex fuel with a real fuel composition sensor. Today, it's already flex fuel (I mean auto-correction of K in live according to ethanol content by adding some routines in the ECU and taking advantage of the sensors already available) but I want to push it further
Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Nissan ECU Tuning Forum Index -> 300zx Chip Tuning All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group


Free Forum Free Top Site List
Make this Forum Ad-Free