ecuEdit v2.4 - ECU Tuning & Logging solution

Developer topics relating to software that provides a tuning UI to alter ECU code and data

Moderator: Freon

Postby crazymikie » Thu Dec 22, 2005 3:27 pm

Hi epifan,

I have a question for you- I am working with data values that are two bytes each. I'd like to write an equation that works with each byte separately and then combines the values.

Is there a way I could do this. Basically, I need to do something like:

func_2val = [byte1 - 128] + [byte2 / 256]

Is this possible?

Thanks!
Mike
crazymikie
 
Posts: 105
Joined: Mon Jan 03, 2005 6:45 pm
Location: Watertown, MA

Postby crazymikie » Thu Dec 22, 2005 6:21 pm

Also, I have a question about endienness:

I'm trying to import the CL/OL delay periods- the data looks like (0x28D72 in the 2004 WRX ROM):

01 6E 08 1B 02 DC 02 DC

when i translate to decimal using hexcmp (big endian mode assuming 2 byte words) this is:

366 2075 732 732

but in ecuedit, this comes up as

28161 6920 56322 56322

It appears that the endienness is backwards or something. If you translate those numbers back to hex you get:

6E 01 1B 08 DC 02 DC 02

Am I doing something wrong?

Thanks again! I'm trying to add a bunch of tables in right now- I'm getting there slowly.


Mike
crazymikie
 
Posts: 105
Joined: Mon Jan 03, 2005 6:45 pm
Location: Watertown, MA

Postby epifan » Thu Dec 22, 2005 11:08 pm

crazymikie wrote:Is there a way I could do this. Basically, I need to do something like:

func_2val = [byte1 - 128] + [byte2 / 256]

Is this possible?

Yes, I put link to new version soon :wink: but, I think correctly would be byte0, byte1 :wink:
would be: func_2val = ([byte0] - 128) + [byte1] / 256
Last edited by epifan on Fri Dec 23, 2005 2:08 am, edited 1 time in total.
epifan
 
Posts: 197
Joined: Sat Nov 26, 2005 1:23 am

Postby epifan » Thu Dec 22, 2005 11:13 pm

crazymikie wrote:Also, I have a question about endienness:

I'm trying to import the CL/OL delay periods- the data looks like (0x28D72 in the 2004 WRX ROM):

01 6E 08 1B 02 DC 02 DC

when i translate to decimal using hexcmp (big endian mode assuming 2 byte words) this is:

366 2075 732 732

but in ecuedit, this comes up as

28161 6920 56322 56322

It appears that the endienness is backwards or something. If you translate those numbers back to hex you get:

6E 01 1B 08 DC 02 DC 02

Am I doing something wrong?

IMHO, problem is in hexcmp, they are using "reverse bytes" convert method. ecuEdit showing data in processor-like-code. Simple expression for convert is: byte0 + byte1*(256^1) + byte2*(256^2) + etc..

btw, after byte0, byte1 expressions was supported you are easy convert from "direct" to "reverse"
epifan
 
Posts: 197
Joined: Sat Nov 26, 2005 1:23 am

Postby epifan » Fri Dec 23, 2005 1:23 am

This is new version of ecuEdit v1.1.0.23:
- support [byte0], [byte1] in expressions for direct access to each byte in ECU data

Download
epifan
 
Posts: 197
Joined: Sat Nov 26, 2005 1:23 am

Postby qoncept » Fri Dec 23, 2005 5:12 am

epifan, I'mtrying to add injector scaling to my map and I'm having trouble. Here's the XML line I've added

<data count="1" offset="#286BB" power="2" format="%.0f" func_2val="2816000/[value]" func_val2="[value]*2816000" caption="cc" color_dir="0" mul="#FFFF" desc="cc" inc="-20" incb="-100" inc_dir="1"/>

At 0x286BB, the values are 0x192A, 6442 in dec. 2816000 / 6442 should be about 440, but it ecuEdit is saying 261. Any ideas?

BTW, that hex viewer is GREAT.

Edit: I took out the constant and eduEdit displays the value as 10777
qoncept
 
Posts: 249
Joined: Tue Oct 04, 2005 6:43 pm
Location: Montgomery, AL

Postby epifan » Fri Dec 23, 2005 5:48 am

qoncept wrote:At 0x286BB, the values are 0x192A, 6442 in dec. 2816000 / 6442 should be about 440, but it ecuEdit is saying 261. Any ideas?

this is same thing like crazymikie write above. At 0x286bb we have a 0x19, 0x2A this is equal 2byte integer = 10777 dec (hexViewer show this number). But if we use reverse byte mode then result is 6442.

Just look at row data sequence for Fuel Map, it's a RPM sequence of 2byte integers. Integers are in normal format: lowByte, highByte etc. It's a proof. To convert this integers to RPM we are only mul it to 50. It's simple - and this is proof too. Impossible to convert RPM values represented in reverse byte mode...

P.S. I don't understand, where from you are take "2816000"? and what a tool (soft) show 2byte integer from 0x286bb offset like 6442?
Last edited by epifan on Fri Dec 23, 2005 5:53 am, edited 1 time in total.
epifan
 
Posts: 197
Joined: Sat Nov 26, 2005 1:23 am

Postby crazymikie » Fri Dec 23, 2005 5:51 am

AWESOME!

Thank you.

Mike
crazymikie
 
Posts: 105
Joined: Mon Jan 03, 2005 6:45 pm
Location: Watertown, MA

Postby qoncept » Fri Dec 23, 2005 7:47 am

epifan, 2816000 is the constant I calculated playing with that value and the USDM STi injector flow rates.

I typed 192A in to windows calculator and switched to dec to get 6442. Also, if, 0x19 = 25, 25 * 256 = 6400. 0x2A = 42, 6400 + 42 = 6442. Am I off? I don't understand where 10777 comes from.
qoncept
 
Posts: 249
Joined: Tue Oct 04, 2005 6:43 pm
Location: Montgomery, AL

Postby epifan » Fri Dec 23, 2005 7:57 am

qoncept wrote:epifan, 2816000 is the constant I calculated playing with that value and the USDM STi injector flow rates.

I typed 192A in to windows calculator and switched to dec to get 6442. Also, if, 0x19 = 25, 25 * 256 = 6400. 0x2A = 42, 6400 + 42 = 6442. Am I off? I don't understand where 10777 comes from.

Your calculation is not correct. Expression is 25(0x19) + 42(0x2a)*256= 10777. You must invert bytes sequence when type in windows calculator. It's basis of assembler programming
epifan
 
Posts: 197
Joined: Sat Nov 26, 2005 1:23 am

Postby qoncept » Fri Dec 23, 2005 8:13 am

Doh! That clears that up. :)
qoncept
 
Posts: 249
Joined: Tue Oct 04, 2005 6:43 pm
Location: Montgomery, AL

Postby Jeramie » Fri Dec 23, 2005 8:22 am

The 2d maps (Visual) only show positive plot points. How do we make it show negative points.

The values for the turbo dynamics have negative and positive values so .. the visual map does not display right. Any help would be great.
Jeramie
 
Posts: 155
Joined: Thu Jun 23, 2005 12:45 pm
Location: Quakertown, PA

Postby epifan » Sat Dec 24, 2005 9:22 am

ecuEdit v.1.1.0.25 (Merry Christmas Edition :D)
New:
- Functions support (built-in editor). To use function just type function name with "()" in expression from map descriptions (example: func_2val="toRPM()").
- 2D Graph Mouse Navigation and real values axis support

Download

This is XML-struct with some functions.
Code: Select all
<ecu_tools>
<function name="toRPM" expr="[value]*50"/>
<function name="frRPM" expr="[value]/50" dir="0"/>
<function name="toAFR" expr="14.7/(1 + ([value] / 128))"/>
<function name="frAFR" expr="(14.7*128)/[value]-128" dir="0"/>
<function name="toLoad" expr="[value]/8192"/>
<function name="frLoad" expr="[value]*8192" dir="0"/>
<function name="toIgn" expr="([value]-57) * 360 / 1024"/>
<function name="toIgnC" expr="[value] * 360 / 1024"/>
<function name="toThrt" expr="[value]*100/169"/>
<function name="toWDuty" expr="[value]*100/246"/>
<function name="toBoostBar" expr="[value]/93.7"/>
<function name="toAirFlow16" expr="[value]*300/65536"/>
<function name="toMAFvolt" expr="[value]*0.019534"/>
</ecu_tools>
epifan
 
Posts: 197
Joined: Sat Nov 26, 2005 1:23 am

Postby Kha0S » Tue Jan 03, 2006 1:45 pm

Jeramie wrote:The 2d maps (Visual) only show positive plot points. How do we make it show negative points.

The values for the turbo dynamics have negative and positive values so .. the visual map does not display right. Any help would be great.


I managed to get useful turbo dynamics maps displaying with the following snippet... it's a workaround, but it works at least one-way... I haven't tested exporting back out to hex. YMMV.

The increment sizes are also too big, but I can't seem to get increments of less than 1 to work.

Code: Select all
<map name="Turbo Dynamics Proportional (Continuous)" type="2">
<rows count="9" func_2val="(([byte0]*256+[byte1]/256)-32768)/760" func_val2="" offset="#2B56F" power="2" format="%.2f" mul="#FFFF" caption="Boost Pressure Error (PSI)" desc="Boost Pressure Error (PSI)"/>
<data func_2val="([byte0]*256+[byte1]/256)/256-50" func_val2="" offset="#2B583" power="2" format="%.4f" mul="#FFFF" caption="Adjustment (%)" desc="Adjustment (%)" color_dir="0" inc="1" incb="5" inc_dir="1"/>
</map>
<map name="Turbo Dynamics Proportional (Burst)" type="2">
<rows count="9" func_2val="(([byte0]*256+[byte1]/256)-32768)/760" func_val2="" offset="#2B595" power="2" format="%.2f" mul="#FFFF" caption="Boost Pressure Error (PSI)" desc="Boost Pressure Error (PSI)"/>
<data func_2val="([byte0]*256+[byte1]/256)/256-50" func_val2="" offset="#2B5A9" power="2" format="%.4f" mul="#FFFF" caption="Adjustment (%)" desc="Adjustment (%)" color_dir="0" inc="1" incb="5" inc_dir="1"/>
</map>
Kha0S
 
Posts: 106
Joined: Tue Jan 11, 2005 12:30 pm
Location: MY02 USDM WRX / Nashua, NH

Postby Jeramie » Tue Jan 03, 2006 2:05 pm

Kha0S wrote:
Jeramie wrote:The 2d maps (Visual) only show positive plot points. How do we make it show negative points.

The values for the turbo dynamics have negative and positive values so .. the visual map does not display right. Any help would be great.


I managed to get useful turbo dynamics maps displaying with the following snippet... it's a workaround, but it works at least one-way... I haven't tested exporting back out to hex. YMMV.

The increment sizes are also too big, but I can't seem to get increments of less than 1 to work.

Code: Select all
<map name="Turbo Dynamics Proportional (Continuous)" type="2">
<rows count="9" func_2val="(([byte0]*256+[byte1]/256)-32768)/760" func_val2="" offset="#2B56F" power="2" format="%.2f" mul="#FFFF" caption="Boost Pressure Error (PSI)" desc="Boost Pressure Error (PSI)"/>
<data func_2val="([byte0]*256+[byte1]/256)/256-50" func_val2="" offset="#2B583" power="2" format="%.4f" mul="#FFFF" caption="Adjustment (%)" desc="Adjustment (%)" color_dir="0" inc="1" incb="5" inc_dir="1"/>
</map>
<map name="Turbo Dynamics Proportional (Burst)" type="2">
<rows count="9" func_2val="(([byte0]*256+[byte1]/256)-32768)/760" func_val2="" offset="#2B595" power="2" format="%.2f" mul="#FFFF" caption="Boost Pressure Error (PSI)" desc="Boost Pressure Error (PSI)"/>
<data func_2val="([byte0]*256+[byte1]/256)/256-50" func_val2="" offset="#2B5A9" power="2" format="%.4f" mul="#FFFF" caption="Adjustment (%)" desc="Adjustment (%)" color_dir="0" inc="1" incb="5" inc_dir="1"/>
</map>



this was fixed in the last realease of ecuEdit. Turbo dynamics now displays properly. Thanks tho.
Last edited by Jeramie on Tue Jan 03, 2006 2:10 pm, edited 1 time in total.
Jeramie
 
Posts: 155
Joined: Thu Jun 23, 2005 12:45 pm
Location: Quakertown, PA

PreviousNext

Return to Tuning Software

Who is online

Users browsing this forum: No registered users and 2 guests