PDA

View Full Version : dec to hex conversion, understanding stored mileage



VTS_Tibi
28th June, 2012, 09:28 AM
Hi Guys,

I'm the kind of person who wants to know what is going on when I do something with a software.

For example, the troublesome Scenic II. with the 93C56 EEPROM. Tachosoft gives the following:

Car type: Renault Scenic Johnson Controls - 93c56 - 2004 year
The mileage is stored in the next lines:
0000: 1D BF E2 40 00 01 1D BF E2 40 00 01 1D BF E2 40
0010: 00 01 1D BF E2 40 00 01 xx xx xx xx xx xx xx xx
where the next bytes:
1D BF E2 40 00 01 - is a mileage



So, the mileage value in HEX format is 1D BF E2 40 00 01

When I convert that using a simple HEX to DEC converter, it gives the following: 32709971804161



And an other eaxmple, the other way round:

100000km = 795F86A00001


How could I calculate the actual mileage from that?

Sorry for asking such a noob question but I would like to learn :stoned:

captain crackers
28th June, 2012, 10:54 AM
Firstly Tachosoft, a lot of the time shows the calculation bytes reversed. It should read BF 1D 40 E2 01 00. Now to calculate the kms. reverse the complete algo ie. 00 01 E2 40 1D BF. The kms. are at 00 01 E2 40 and the 1D BF is a not (hex reversed) of E2 40. So to calculate the algo for any Kms. say 75,000, change to hex 124F8. Put zero's in front to give 00 01 24 F8. The not of 24 F8 is DB 07 (to get the not, subtract say 4 from 15 = 11 or in hex B, so the not of 4 is B. You can use windows scientific calculator, enter 24F8 press not you will get DB07 preceeded by FFFF's ignore the FF's and there is the not. So the complete algo is 00 01 24 F8 DB 07. Reverse it to 07 DB F8 24 01 00 and repeat it 4 times. Arthur.

chrismoore02
28th June, 2012, 11:19 AM
this thread explains this well with examples

http://www.digital-kaos.co.uk/forums/f174/please-explain-me-247942/

Lidahus
28th June, 2012, 11:27 AM
Manufacturers of EEPROM mainly guarantee 1.000.000 write cycles, so software designer tries to keep below this amount of write cycles. Additionally fractions of a km needs to be counted as well. Because of this reasons the mileage as shown in the EEPROM is not same as shown in the odometer, instead you need to multiply the result found by Arthur by as an example 8, 16, or 32 to find final odometer value.

captain crackers
28th June, 2012, 11:33 AM
Lidahus, I think you are wrong in this case. Arthur.

ALEXEI
28th June, 2012, 11:34 AM
this will help more than necessary !

PremierD
28th June, 2012, 11:39 AM
Bells and whistles .. check your upload please !!!!!!!

Removed the AV warning from Upload (I hope) lol

Lidahus
28th June, 2012, 11:56 AM
Lidahus, I think you are wrong in this case. Arthur.
And why do you think so?

captain crackers
28th June, 2012, 12:03 PM
Because I have done hundreds of them this way with 100% success. Arthur.

Lidahus
28th June, 2012, 12:08 PM
Probably you answered specific on the Scenic dump. My post wasn't intended this way. I thought question was more general, so I offered some more options how to calculate mileage from dump.

ALEXEI
28th June, 2012, 12:09 PM
Bells and whistles .. check your upload please !!!!!!!

sorry boss !
removed

VTS_Tibi
28th June, 2012, 12:12 PM
Probably you answered specific on the Scenic dump. My post wasn't intended this way. I thought question was more general, so I offered some more options how to calculate mileage from dump.


this was really a general question, I just threw up the Scenic to give an example!

captain crackers
28th June, 2012, 12:18 PM
Lidahus, This is mileage correction not missile programming. For example a Volvo algo covers 204 km, over 51 locations and can be set to an accuracy of plus or minus 4 kms. but is a pain to edit and no one does it that way. Everyone I know just edits it to +/- 204 kms. All the Dealer tools also work that way. Arthur.

Lidahus
28th June, 2012, 12:28 PM
Excel is my friend. Our interests are different, Arthur, for me it's missile programming, while for you it's just unnecessary. Different targets, different tools, just subject is same.

vageric
28th June, 2012, 06:10 PM
captain crackers dont you mean in your ex. 75000 instead of 63000?

captain crackers
28th June, 2012, 06:19 PM
Vageric, OOPS.Yes, sorry, I changed it because of zero's confusing the algo I was explaining. I originally meant to use 64,000 but it has 00 in it and 63,000 only has 4 figures and I wanted one with 5 starting with 1 as in the original question. Apologies to all but only you had noticed. I have already edited the post. Arthur.

TULGEYWOODMAN
28th June, 2012, 07:00 PM
Excel is my friend. Our interests are different, Arthur, for me it's missile programming, while for you it's just unnecessary. Different targets, different tools, just subject is same.

well in the real world, my customers say put it to 3000, it could mean 2900 3000 3100 3200 or anything!