PDA

View Full Version : Introduction to HPL Scripts for orange5 - DashBoard. educational purpose



richiebb
23rd April, 2018, 03:50 PM
some time ago I started to make some script for orange5, I know that many of you here know how to make them ................ for those who do not, here goes......

; Clio Mio Magneti Marelli / Sandero with 95020 tested in 2014 models
; comments for this sample script is based in 41200km
;---------------------------------------------------------------------------------------------------
;................................................. 41200 * 1000 = 41200000 ---------------------------------------
;................................................. 41200000 toHex = 02 74 A9 80 ----------------------------------
;................................................. 02 74 A9 80 Swap = 80 a9 74 02 --------------------------------
;................................................. first 4 bytes 80 A9 74 02 ---------------------------------------
;................................................. 80 A9 74 02 xor FF FF FF FF = 7F 56 8B FD (last four Bytes) -----
;---------------------------------------------------------------------------------------------------



ClioMio.hpl

;-------------------------------------------------------------------------------------------------------------------------------------------
[!#"Old KM"]
ADR=192;..................Set in position 192 decimal = hex 0x0c0
R6=1;.....................Put 1 in Registry R6
LOOP=(0,63){;.............Start a Loop 64 cycles
MARK=R6;..................Mark Current Position
ADR=+1;...................Increment in 1 Address
};........................end of loop
ADR=195;..................Set in position 195 decimal = 0x0c3
R6=DATA;..................Stored Current data Buffer(0x0c3) in Registry R6
ADR=-1;...................decrement in 1 Address
R7=DATA;..................Stored Current data Buffer(0x0c2) in Registry R7
ADR=-1;...................decrement in 1 Address
R8=DATA;..................Stored Current data Buffer(0x0c1) in Registry R8
ADR=-1;...................decrement in 1 Address
R9=DATA;..................Stored Current data Buffer(0x0c0) in Registry R9, asume for this sample 0x080
R6=<<24;..................move 6 nibble to left R6 Value. Sample R6 vale are 0x002 after move: 0x02000000
R7=<<16;..................move 4 nibble to left R7 Value. Sample R7 vale are 0x074 after move: 0x00740000
R8=<<8;...................move 2 nibble to left R8 Value. Sample R8 vale are 0x0a9 after move: 0x0000A900
R8=+R6;...................sum R8 Value to R6.....0x0000A900 + 0x02000000 = 0x0200A900
R8=+R7;...................sum R8 Value to R7.....0x0200A900 + 0x00740000 = 0x0274A900
R8=+R9;...................sum R8 Value to R9.....0x0274A900 + 0x00000080 = 0x0274A980
R8=/1000;.................divide by decimal 1000 R8 value....... 0x0274A980 / 1000 = 0x0A0F0
PRINT=("Current Mileage = %06lu km.",R8);..Print Rezult

[!#"New KM"]
R4=0;.....................Put 0 in Registry R6
GET=("Enter New KM",R4);..open Dialog Box and Request New Mileage end stored in R4...asume for this example 41200km
R4=*1000;.................multiply R4 registry by 1000 ......R4 * 1000 = 41200000
R9=1;.....................Put 1 in Registry R9
R3=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R3 registry (41200000)=(0x0274A980)
R5=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R5 registry (41200000)=(0x0274A980)
R6=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R6 registry (41200000)=(0x0274A980)
R3=&000000FFH;............make a AND Logical R3 by 0x0ff....... 0x0274A980 AND 0x000000FF = 0x00000080
R4=&0000FF00H;............make a AND Logical R4 by 0x0ff00..... 0x0274A980 AND 0x0000FF00 = 0x0000A900
R5=&000FF0000H;...........make a AND Logical R5 by 0x0ff0000... 0x0274A980 AND 0x00FF0000 = 0x00740000
R6=&0FF000000H;...........make a AND Logical R6 by 0x0ff000000. 0x0274A980 AND 0xFF000000 = 0x02000000
R4=>>8;...................move to right 2 nibble...0x0000A900 to 0x000000A9
R5=>>16;..................move to right 4 nibble...0x00740000 to 0x00000074
R6=>>24;..................move to right 6 nibble...0x02000000 to 0x00000002

ADR=192;..................Set in position 192 decimal = hex 0x0c0

LOOP=(0,7){;..............Start a Loop 8 cycles
DATA=R3;..................set Value 0x00000080 (80) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R4;..................set Value 0x000000A9 (A9) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R5;..................set Value 0x00000074 (74) in current Position
MARK=R9;..................Mark postion 194(c2)
ADR=+1;...................Increment in 1 address
DATA=R6;..................set Value 0x00000002 (02) in current Position
MARK=R9;..................Mark postion 194(c2)
ADR=+5;...................Increment in 5 address
}
R3=^0FFH;.................R3 xor 0xff....0x00000080 xor 0x000000ff = 7F
R4=^0FFH;.................R4 xor 0xff....0x000000A9 xor 0x000000ff = 56
R5=^0FFH;.................R5 xor 0xff....0x00000074 xor 0x000000ff = 8B
R6=^0FFH;.................R6 xor 0xff....0x00000002 xor 0x000000ff = FD

ADR=196;..................Set in position 196 decimal = hex 0x0c4

LOOP=(0,7){;..............Start a Loop 8 cycles
DATA=R3;..................set Value 0x0000007F (7F) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R4;..................set Value 0x00000056 (56) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R5;..................set Value 0x0000008B (8B) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R6;..................set Value 0x00000080 (FD) in current Position
MARK=R9;..................Markcurrent position
ADR=+5;...................Increment in 5 address

leave HPL file in attachment

for see in type menu......... must to add to CFG File:

Sample:
GROUP=Renault ; if not exist
CHIP=Clio Mio / Sandero 95020,256x8,"HPL_ROOT_DIRECTORY"\ClioMio.hpl

Questions and Request made here: Question and Request for HPL Orange5 Scripts (http://www.digital-kaos.co.uk/forums/showthread.php/656401-Question-and-Request-for-HPL-Orange5-Scripts)

richiebb
15th June, 2018, 09:33 PM
I leave the algorithm for a BSI siemens E02-00 of peugeot 207 year 2013 that I did today, .........when I can........i do the script!

Tested en Peugeot 207 year 2013

KM * 10 -> XOR FFFFFF -> BYTES SWAP = KM 3 BYTES [0]xx [1]xx [2]xx

KM BYTE for calc CS[0] = add FF to left... sample FFxx
KM BYTE for calc CS[1] = add FF to left... sample FFxx
KM BYTE for calc CS[2] = add FF to left... sample FFxx

checksum 1 0x12B= 0x12F + 0x130 + KM BYTE for CS[0] + KM BYTE for CS[1] + KM BYTE for CS[2] - 1FD AND FF
checksum 2 0x131= checksum 1 - (0x12A - 0x130)

*NOTE: addresses are in format 0x00, values are in format 00

Lines 120 and 130 for this sample, with 75000km
0x120: 1F FF F9 37 6B F7 FC FA FB FF 49 1D 4F 8E F4 FF
0x130: 4A1E 4F 8E F4 FF 7C C0 DE 64 EB FF AB 5C FD FF

sample 75000km

75000 * 10 = 750000
750000 toHex= 0B 71 B0
0B 71 B0 xor FFFFFF = F4 8E 4F
F4 8E 4F swap = 4F 8E F4

4F 8E F4 (km bytes) 0x12c=4F,0x12d=8E,0x12e=F4,0x132=4F,0x133=8E,0x134 =F4

checksum 1 0x12B= FF + 4A + FF4F + FF8E + FFF4 = 3001A
3001A - 1FD = 2FE1D
2FE1D AND FF = 1D

checksum 2 0x131= 49 - 4A = -1
1D - -1 = 1E


address km in lines 0x120 and 0x130
0x120: XX XX XX XX XX XX XX XX XX XX XX 1D 4F 8E F4 XX
0x130: XX 1E 4F 8E F4 XX XX XX XX XX XX XX XX XX XX XX

Questions and Request made here: Question and Request for HPL Orange5 Scripts (http://www.digital-kaos.co.uk/forums/showthread.php/656401-Question-and-Request-for-HPL-Orange5-Scripts)

richiebb
18th June, 2018, 01:43 PM
continuing with the previous post ......... I leave the script for BSI siemens E02-00 of peugeot 207 year 2013

; CHIP=25c160 (2048x8) SPI
HPL=25c256.hpl
POWER=0
R0="New KM",D;................................Set R0 Registry as Decimal for input dialog

[!#"KM"]
ADR=0x131;....................................set address in hex 131
LOOP=(0,3){;..................................star t a loop of 4 cycles
MARK=1;.......................................put mark in current position
ADR=+1;.......................................incr ements address in 1
};............................................end of loop
ADR=+2;.......................................incr ements address in 2 hex 133
LOOP=(0,3){;..................................star t a loop of 4 cycles
MARK=1;.......................................put mark in current position
ADR=+1;.......................................incr ements address in 1
};.............................................end of loop
ADR=-7;.......................................decrement s address in 7 hex 12c
R4=DATA;.......................................... store current data in R4 registry
ADR=-1;.......................................decrement s address in 1 hex 12b
R5=DATA;......................................stor e current data in R5 registry
ADR=-1;.......................................decrement s address in 1 hex 12a
R6=DATA;......................................stor e current data in R6 registry
R8=0FFFFFFH;..................................assi gns to R8 registry value hex FFFFFF
R4=<<16;......................................move four nibble to left R4 registry
R5=<<8;.......................................move two nibble to left R5 registry
R4=+R6;.......................................add R6 to R4
R4=+R5;.......................................add R5 to R4
R4=^R8;.......................................xor R4 to R8
R4=/10;.......................................divide R4 by 10
PRINT=("Current KM: %06lu km.",R4);...........PRINT R4 in decimal format "%06lu" fill six 0 to left

[!#"New KM"]
R0=0;.........................................assi gns to R0 registry value hex 0
GET=("New Km",R0);............................Open a input dialog and store in registry R0(decimal)
R0?<100{;.....................................if R0 is minor to 100 then executed code between {}
PRINT=A("No less than 100 km!");..............print a warning
EXIT;.........................................exit - no more lines are executed
};............................................end if
R0=*10;.......................................mult iply by R0 Registry
R8=0FFFFH;....................................assi gns to R8 registry value hex FFFF
R5=R0;........................................assi gns to R5 registry R0
R6=R0;........................................assi gns to R6 registry R0
R9=255;.......................................assi gns to R9 registry value decimal 255
R5=&00FF0000H;................................make a logical AND to get XX---- value
R5=>>16;......................................move to right 4 nibble
R6=&00F0FF00H;................................make a logical AND to get X-XX-- value
R6=>>8;.......................................move to right 2 nibble
R0=&00F000FFH;................................make a logical AND to get ----XX value
R0=^R8;.......................................xor R0 to R8
R6=^R8;.......................................xor R6 to R8
R5=^R8;.......................................xor R5 to R8
R8=R0;........................................assi gns to R8 registry R0
R8=+R6;.......................................add R6 to R8
R8=+R5;.......................................add R5 to R8
ADR=012FH;....................................set address in hex 12F
R2=0;.........................................set R2 to 0
LOOP=(0,1){;..................................star t a loop of 2 cycles
R3=DATA;......................................stor e data in R3
R2=+R3;.......................................add R3 to R2
ADR=+1;.......................................incr ements address in 1
};............................................end of loop
R8=+R2;.......................................add R2 to R8
R8=-01FDH;....................................subtract 1FD to R8
R8=&000FFH;...................................make a logical AND to get ----XX value
R9=R8;........................................assi gns to R9 registry R8
ADR=-7;.......................................move cursor to address 12A
R1=DATA;......................................stor e data in R1
ADR=+6;.......................................move cursor to address 130
R2=DATA;......................................stor e data in R2
R1=-R2;.......................................subtract R2 to R1
R9=-R1;.......................................subtract R1 to R9
ADR=-5;.......................................move cursor to address 12B
DATA=R8;......................................chan ge CS 1 data
MARK=1;.......................................mark position
ADR=+1;.......................................incr ements address in 1
DATA=R0;......................................chan ge KM byte[0]
MARK=1;.......................................mark position
ADR=+1;.......................................incr ements address in 1
DATA=R6;......................................chan ge KM byte[1]
MARK=1;.......................................mark position
ADR=+1;.......................................incr ements address in 1
DATA=R5;......................................chan ge KM byte[2]
MARK=1;.......................................mark position
ADR=+3;.......................................incr ements address in 3
DATA=R9;......................................chan ge CS 2 data
MARK=1;.......................................mark position
ADR=+1;.......................................incr ements address in 1
DATA=R0;......................................chan ge KM byte[0]
MARK=1;.......................................mark position
ADR=+1;.......................................incr ements address in 1
DATA=R6;......................................chan ge KM byte[1]
MARK=1;.......................................mark position
ADR=+1;.......................................incr ements address in 1
DATA=R5;......................................chan ge KM byte[2]
MARK=1;.......................................mark position

GROUP=Peugeot; if not exist
CHIP=206/7 BSI Siemens 95160,2Kx8,Dash/206BSI7.hpl; assuming that in the folder of the HPL directory the folder for the dashboard is called "Dash"

Questions and Request made here: Question and Request for HPL Orange5 Scripts (http://www.digital-kaos.co.uk/forums/showthread.php/656401-Question-and-Request-for-HPL-Orange5-Scripts)

mikroel
21st January, 2019, 12:32 PM
can you explain,or give calculating , on this example, how to calculate PIN code from this file

Real pin code is 4362

in the file pin showed as 4326

Dr. Zoidberg
21st January, 2019, 12:37 PM
4326 Is ASCII---

mikroel
21st January, 2019, 01:02 PM
yes 4326 in ASCII , so?

Dr. Zoidberg
21st January, 2019, 01:08 PM
yes 4326 in ASCII , so?





588991


Now, look again your file.....

mikroel
21st January, 2019, 01:32 PM
You didn't understand me well,
or i didn't explain well

i already showed on my photo (RED square) where is pin in HEX and in ASCII and which one is Real PIN CODE

I asked how to make procedure in calcs for read PIN code from this location

richiebb
21st January, 2019, 04:06 PM
You didn't understand me well,
or i didn't explain well

i already showed on my photo (RED square) where is pin in HEX and in ASCII and which one is Real PIN CODE

I asked how to make procedure in calcs for read PIN code from this location

Hi. look this (https://www.digital-kaos.co.uk/forums/showthread.php/656399-Introduction-and-First-Examples-of-HPL-scripts-for-Orange5?p=3301762&viewfull=1#post3301762)

richiebb
21st January, 2019, 05:20 PM
; read PIN Code
@ART=4

["!#READ PIN"]
ADR=0x1e6
LOOP(4){
R0=DATA
@ART[I]=R0
ADR=+1
}
PRINT=("Pin code is %s",@ART)

mikroel
21st January, 2019, 07:07 PM
hanks friend
but result is

richiebb
21st January, 2019, 08:05 PM
I just tried and the script works well.

I was guided by the photo of your post and begins to read the ascii in the address 0x1e6.

put a mark to see if you have the address well

; read PIN Code
@ART=4

["!#READ PIN"]
ADR=0x1e6
LOOP(4){
R0=DATA
@ART[I]=R0,MARK=1
ADR=+1
}
PRINT=("Pin code is %s",@ART)

richiebb
21st January, 2019, 09:06 PM
16bits eeprom script

; read PIN Code
HPL=93c66.hpl
@PIN=4

["!#READ PIN"]
ADR=0x0f3
R0=DATA,R1=R0
R0=&0FF00H,R0=>>8
R1=&0FFH
ADR=+1
R2=DATA,R3=R2
R2=&0FF00H,R2=>>8
R3=&0FFH
@PIN[0]=R0,@PIN[1]=R1,@PIN[3]=R2,@PIN[2]=R3
PRINT=("Pin code is %s",@PIN)

mikroel
22nd January, 2019, 01:22 PM
last one working good

note:
vectra c has several different version of clusters as well dumps ,so universal dash calculator is very difficult to make

Catalizator
29th January, 2019, 10:34 PM
for renault have more script?

mikroel
1st February, 2019, 02:23 PM
https://uploads.tapatalk-cdn.com/20190201/d56cf21c4e398e5417612a0729edb90b.jpg
yes have some Renault dash and ABS scripts

mikroel
1st February, 2019, 02:26 PM
.................

ledong
21st May, 2019, 05:04 PM
Hi DK mem!
Can help me explain this script for Denso c46.

621478

0000: xx xx xx xx xx xx xx xx 6F FF FF F8 6F FF FF F8
0010: 6F FF FF F8 xx xx xx xx xx xx xx xx xx xx xx xx
where the next bytes:
6F FF FF F8 - is a mileage



["Old mileage"]
ADR = 4,
LOOP = (0.5) {MARK = 1, ADR = + 1}
ADR = 5,
R1 = DATA,
R1 = << 16
ADR = -1,
R5 = DATA,
R1 = + R5,
R1 = ^ 0FFFFFFFFH
ADR = 0,
LOOP = (0.3) {R8 = DATA, R8? 65535 {BREAK},
R1 = + 1,
R2 = R1,
R2 = & 000000FH,
R2? 10 {R1 = -10, R1 = + 16}, ADR = + 1}
PRINT = ("Current mileage =% 06lx km.", R1)


["New mileage"]
R4 = 0,
GET = ("New mileage", R4)
R8 = 0FFFFH,
R5 = R4,
R6 = R4
R5 = & 0FF0000H,
R6 = & 000FFFFH,
R5 = >> 16,
R5 = ^ R8, ​​
R6 = ^ R8,
​​ADR = 4,
R9 = 1
LOOP = (0,2) {DATA = R6, MARK = R9, ADR = + 1, DATA = R5, MARK = R9, ADR = + 1}

richiebb
31st May, 2019, 01:03 AM
Hi DK mem!
Can help me explain this script for Denso c46.

621478

0000: xx xx xx xx xx xx xx xx 6F FF FF F8 6F FF FF F8
0010: 6F FF FF F8 xx xx xx xx xx xx xx xx xx xx xx xx
where the next bytes:
6F FF FF F8 - is a mileage



["Old mileage"]
ADR = 4,
LOOP = (0.5) {MARK = 1, ADR = + 1}
ADR = 5,
R1 = DATA,
R1 = << 16
ADR = -1,
R5 = DATA,
R1 = + R5,
R1 = ^ 0FFFFFFFFH
ADR = 0,
LOOP = (0.3) {R8 = DATA, R8? 65535 {BREAK},
R1 = + 1,
R2 = R1,
R2 = & 000000FH,
R2? 10 {R1 = -10, R1 = + 16}, ADR = + 1}
PRINT = ("Current mileage =% 06lx km.", R1)


["New mileage"]
R4 = 0,
GET = ("New mileage", R4)
R8 = 0FFFFH,
R5 = R4,
R6 = R4
R5 = & 0FF0000H,
R6 = & 000FFFFH,
R5 = >> 16,
R5 = ^ R8, ​​
R6 = ^ R8,
​​ADR = 4,
R9 = 1
LOOP = (0,2) {DATA = R6, MARK = R9, ADR = + 1, DATA = R5, MARK = R9, ADR = + 1}

take a look on this thread
Introduction to HPL Scripts for orange5 - DashBoard. educational purpose (https://www.digital-kaos.co.uk/forums/showthread.php/658987-Introduction-to-HPL-Scripts-for-orange5-DashBoard-educational-purpose)

ledong
4th June, 2019, 07:04 AM
take a look on this thread
Introduction to HPL Scripts for orange5 - DashBoard. educational purpose (https://www.digital-kaos.co.uk/forums/showthread.php/658987-Introduction-to-HPL-Scripts-for-orange5-DashBoard-educational-purpose)

I read it but i dont understand this paragraph below can explain for me:
LOOP = (0.3) {R8 = DATA, R8? 65535 {BREAK},
R2? 10 {R1 = -10, R1 = + 16}, ADR = + 1}

hcip
17th August, 2019, 02:31 PM
This is the first time I try to write a script for this programmer....... I feel a headache now, this is new to me...

Yazaki algo, exact calculation....

mikroel
17th August, 2019, 07:59 PM
This is the first time I try to write a script for this programmer....... I feel a headache now, this is new to me...

Yazaki algo, exact calculation....You are good, for the biginner .



Sent from my HONOR 8X

hcip
18th August, 2019, 07:00 AM
You are good, for the biginner .

Thanks,

Added the algorithm for DENSO ALGO


is there any better way to convert Dec number into hex number?

hcip
2nd September, 2019, 08:50 PM
added visteon algorithm, Ford Ecosport 9S12XEG384

gogalv
3rd September, 2019, 07:08 AM
Why you need to reinvent the wheel?

drpeter
3rd September, 2019, 08:05 AM
Why you need to reinvent the wheel?maybe time for something new, write scripts in PHP.

XJTAG
11th November, 2019, 01:49 AM
I leave the algorithm for a BSI siemens E02-00 of peugeot 207 year 2013 that I did today, .........when I can........i do the script!

Tested en Peugeot 207 year 2013

KM * 10 -> XOR FFFFFF -> BYTES SWAP = KM 3 BYTES [0]xx [1]xx [2]xx

KM BYTE for calc CS[0] = add FF to left... sample FFxx
KM BYTE for calc CS[1] = add FF to left... sample FFxx
KM BYTE for calc CS[2] = add FF to left... sample FFxx

checksum 1 0x12B= 0x12F + 0x130 + KM BYTE for CS[0] + KM BYTE for CS[1] + KM BYTE for CS[2] - 1FD AND FF
checksum 2 0x131= checksum 1 - (0x12A - 0x130)

*NOTE: addresses are in format 0x00, values are in format 00

Lines 120 and 130 for this sample, with 75000km
0x120: 1F FF F9 37 6B F7 FC FA FB FF 49 1D 4F 8E F4 FF
0x130: 4A1E 4F 8E F4 FF 7C C0 DE 64 EB FF AB 5C FD FF

sample 75000km

75000 * 10 = 750000
750000 toHex= 0B 71 B0
0B 71 B0 xor FFFFFF = F4 8E 4F
F4 8E 4F swap = 4F 8E F4

4F 8E F4 (km bytes) 0x12c=4F,0x12d=8E,0x12e=F4,0x132=4F,0x133=8E,0x134 =F4

checksum 1 0x12B= FF + 4A + FF4F + FF8E + FFF4 = 3001A
3001A - 1FD = 2FE1D
2FE1D AND FF = 1D

checksum 2 0x131= 49 - 4A = -1
1D - -1 = 1E


address km in lines 0x120 and 0x130
0x120: XX XX XX XX XX XX XX XX XX XX XX 1D 4F 8E F4 XX
0x130: XX 1E 4F 8E F4 XX XX XX XX XX XX XX XX XX XX XX

Questions and Request made here: Question and Request for HPL Orange5 Scripts (http://www.digital-kaos.co.uk/forums/showthread.php/656401-Question-and-Request-for-HPL-Orange5-Scripts)

a very beautiful work, very clear 1.000.000 thanks

bojanmar
4th April, 2020, 02:40 PM
hcip ford ecosport visteon algo

Can you explain how you calculate the checksum before mileage byte?