Title: me7.5 Disassemble change rpm Post by: Sagishm on July 13, 2021, 02:12:40 AM Hi All,
After a lot of time and learn, i successfully get switch map on my car. I trying to change the rpm by map but all i did not worked. i tried to change the nmot but nothing, also nmot_um, any idea what i missed? Thanks my function: Code: change_rpm_8FFA70: ; CODE XREF: Seg0x22c@8b0000:02B2P Thanks Title: Re: me7.5 Disassemble change rpm Post by: fknbrkn on July 13, 2021, 04:09:50 AM Do not touch nmot!
You should change can-bus byte for nmot and not the nmot itself Open FR on a can-bus message, find message with nmot. For example its a 0x280 byte 2 Now check the the same 0x280 id for the rare used variables (mdverl or something like that) Lets say its 0x280 byte 5 Now find a mdverl in ida and check for cross-reference Youll see some kind of Movb rl4, mdverl Movb 0xF828, rl4 // usually canbytes stored here And the key is the bytes in can-bus message has same order as in the FR so if mdverl is on the byte 5 in FR then nmot should be at byte 2 (F828-3=F825) Just scroll up a bit and youll see ~ movb rl4, nmot movb F825, rl4 This is the place you should call your routine to change rl4 with your nmot value As for code I believe cc_z should be used here not cc_nz Didnt see timer here - when you change the map tacho displays the rpm for a while and then return to original rpm Extp - why? Its just a value not an offset Title: Re: me7.5 Disassemble change rpm Post by: Sagishm on July 13, 2021, 04:44:32 AM thanks for the response, i think I found the function is calling to CAN, looks like F824 AND F825, so need to set a value of them?
Regarding cc_nz, from the c166 doc, i understood cc_nz == NonZero so basically if r4 != 0 it will go to the function? or it mistake? Also about the timer, i tried to find in c166 doc how to add a timer, i didn't find it, what is the right way to do it? thanks! Title: Re: me7.5 Disassemble change rpm Post by: fknbrkn on July 13, 2021, 06:30:36 AM Yep iirc can-bus uses 2 bytes to store word nmot_w
and stock function looks like that mov r4, nmot movb 0xF825, rl4 movb 0xF824, rh4 Change wih calls #8Ch, #1000h movb 0xF825, rl4 movb 0xF824, rh4 Your routine @0xC1000 <...some calculations> ends with loc_1: mov r4, #1234h ; use value equal to 1000rpm, 1234 just for example rets loc_2: mov r4, #5678h ;equal 2000rpm rets loc_def: mov r4, nmot_w ; actual nmot to canbus rets ---- as for cmp its just a subtraction operation iirc, so if you need to know values are equal to each other just use cc_z as for timer - its a counter (ram variable) which you init, add value to it and reset if its reaching its maximum value initialize timer in main multimap routine (timer=0) due to unused ram are typically FF i believe youve made a simple trigger to switch maps only once when button was pressed to prevent a switching loop use this trigger in your can-bus routine to start the timer so basically your routine shold looks like that 1. check for map swiching event. if its present, start the timer. just add 1 to the timer 2. check if timer is running. if timer value > 0 and value < threshold, add 1 to timer and mov selected map to the cluster. if timer >= threshold, mov nmot to the cluster (stock path) and reset the timer (mov timer, zeros). result would be smooth af https://youtu.be/3__up1h4xn4 And btw Beware of using canbus nmot hook on the go when the car equipped with AT/ESP/Haldex Safety cap of rl_w or vss should be used aswell to prevent inadequate reaction of those modules Title: Re: me7.5 Disassemble change rpm Post by: Sagishm on July 14, 2021, 03:25:17 AM Thanks you, that’s very good explanation, i got it works!
Thanks again! Title: Re: me7.5 Disassemble change rpm Post by: Sagishm on July 14, 2021, 04:59:28 AM I have another question, how I can get/check bit from EPROM? i know is possible but i didnt understand how.
|