Pages: [1]
Author Topic: MED9.1 time/seconds/lamp (multimap)  (Read 5233 times)
leeimad
Newbie
*

Karma: +1/-3
Offline Offline

Posts: 22


« on: May 22, 2020, 09:12:56 AM »

Hello everyone
I am working on MED9.1 project map switching i want to customize the time of enabling the EPC lamp time after map i.e for 10 seconds.
until now i can enable or disable EPC lamp.
thank you for your help
Logged
_nameless
Hero Member
*****

Karma: +320/-445
Offline Offline

Posts: 2654



« Reply #1 on: May 22, 2020, 11:54:53 AM »

i think you forgot to attach your ida project Shocked  Roll Eyes
Logged

If you are in the market for a tune and would like the ease of downloading and flashing a dyno tested tune for a fair price check out https://instatune.sellfy.store/
fknbrkn
Hero Member
*****

Karma: +176/-18
Offline Offline

Posts: 1401


mk4 1.8T AUM


« Reply #2 on: May 22, 2020, 02:31:01 PM »

Do some timer
What's the problem?
Logged
leeimad
Newbie
*

Karma: +1/-3
Offline Offline

Posts: 22


« Reply #3 on: May 22, 2020, 03:28:39 PM »

Do some timer
What's the problem?
i did a map switching like basano
thats my new function to turn on/off the EPC light:
Code:
ROM:0047ED30                 lbz       r12, (switch - 0x7FFFF0)(r13)  a byte on memory to save wich mode is active
ROM:0047ED34                 cmpwi     r12, 0
ROM:0047ED38                 beq       loc_47ED58
ROM:0047ED3C                 lbz       r12, (B_nmin - 0x7FFFF0)(r13)
ROM:0047ED40                 cmpwi     r12, 0
ROM:0047ED44                 beq       loc_47ED58
ROM:0047ED48                 lbz       r12, (B_epcl - 0x7FFFF0)(r13)
ROM:0047ED4C                 ori       r12, r12, 0x20
ROM:0047ED50                 stb       r12, (B_epcl - 0x7FFFF0)(r13)
ROM:0047ED54                 b         loc_47ED64
ROM:0047ED58 # ---------------------------------------------------------------------------
ROM:0047ED58
ROM:0047ED58 loc_47ED58:                             # CODE XREF: BASANO_MAIN-7B2E8↑j
ROM:0047ED58                                         # BASANO_MAIN-7B2DC↑j
ROM:0047ED58                 lbz       r12, (B_epcl - 0x7FFFF0)(r13)
ROM:0047ED5C                 rlwinm    r12, r12, 0,27,25
ROM:0047ED60                 stb       r12, (B_epcl - 0x7FFFF0)(r13)
ROM:0047ED64
how can i add a instruction to make timer
many thanks
Logged
leeimad
Newbie
*

Karma: +1/-3
Offline Offline

Posts: 22


« Reply #4 on: May 23, 2020, 02:35:25 PM »

I know that the instruction will by loading the adress of a timer variable and compare it to a value.
But i mean really wich timer could I use it
Logged
prj
Hero Member
*****

Karma: +905/-420
Offline Offline

Posts: 5790


« Reply #5 on: May 23, 2020, 03:17:17 PM »

All functions in the ECU are run within a scheduler in various timeslices, except for things that get run on init and crank-sync.
Almost all map lookups are ms scheduled.

A timer is as simple as creating a counter and incrementing it every time your code is run, comparing it to a stored value, and resetting it/running your logic once you go over it.

You just need to know where you are injecting code. Some things are 1ms, some are 10ms, etc.
Logged

PM's will not be answered, so don't even try.
Log your car properly.
leeimad
Newbie
*

Karma: +1/-3
Offline Offline

Posts: 22


« Reply #6 on: May 24, 2020, 07:06:39 AM »

All functions in the ECU are run within a scheduler in various timeslices, except for things that get run on init and crank-sync.
Almost all map lookups are ms scheduled.

A timer is as simple as creating a counter and incrementing it every time your code is run, comparing it to a stored value, and resetting it/running your logic once you go over it.

You just need to know where you are injecting code. Some things are 1ms, some are 10ms, etc.
Many thanks Prj.
Could I use directly an included timer  for example a timer (stored in RAM) wich start counting after uning the engine?
Logged
fknbrkn
Hero Member
*****

Karma: +176/-18
Offline Offline

Posts: 1401


mk4 1.8T AUM


« Reply #7 on: May 24, 2020, 01:37:06 PM »

Buy an arduino and check the example projects with basic timers
Logged
leeimad
Newbie
*

Karma: +1/-3
Offline Offline

Posts: 22


« Reply #8 on: May 24, 2020, 03:39:07 PM »

thank you all
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.019 seconds with 17 queries. (Pretty URLs adds 0.001s, 0q)