Can you emulate everything?

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
Post Reply
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Can you emulate everything?

Post by joukoy »

Idea:
Load bin-file in emulator (easy68k?) and debug it, to find all tuning tables etc.
Emulate all PCM hardware & engine sensors with software.
For example
- crank sensor signal generated with timer, user select rpm
- cam signal derived from crank signal
- Gear selection with number
- Speed sensor signal calculated from crank sensor using gear selection
- Engine temp sensor (analog signal): user selectable number, (or automatic increase to desired number) supplied to emulator, address where AD converter is normally mapped
- etc...

Is this kind of app already available?
Is idea useful or should I forget this?
Is there enough info available about PCM to create this?
Is easy68k compatible with cpu in p01/p59, or is there compatible emulator available?
Attachments
engineemu-idea1.jpg
engineemu-idea1.jpg (7.41 KiB) Viewed 2031 times
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: Can you emulate everything?

Post by NSFW »

That would take a lot of work. Probably not really hard work, but emulating each sensor signal would take some work, and there are quite a few of them.

That said, I'm pretty sure we could get 99% of the value of that using just an M68k emulator plus a .bin file plus a RAM dump from a PCM while it's idling. That is enough to step through almost any section of code.

Consider a 3-bar hack, or a 2-step rev limiter, for example. The code that reads the sensors doesn't need to change. The code that does change is just going to be reading a few values from RAM (manifold pressure, RPM, vehicle speed, clutch and brake flags, etc) and then writing to some other values in RAM (load, spark advance, fuel-cut flag or spark-cut flag, etc).

That's basically how I did all of my Subaru stuff. We were very fortunate on that platform to have a great compiler/emulator/debugger package that the CPU manufacturer gave away for free just to encourage companies to build stuff with their chips. But I don't recall whether I actually used a full RAM dump or just set the values that I cared about.
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
antus
Site Admin
Posts: 8253
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: Can you emulate everything?

Post by antus »

Its possible, but agree quite a job. "Emulate all PCM hardware & engine sensors with software." is one hell of a job, being a closed source propriety system. If you knew enough to be able to do this successfully, you probably wouldn't need to do it anymore.

You certainly can emulate sensors with a kit like a Jim Stim connected to a real PCM. This is a great way to test code modifications with no risk to your engine.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Can you emulate everything?

Post by joukoy »

Thanks, two good answers.
I think, I don't have enough skills or time for this.
User avatar
antus
Site Admin
Posts: 8253
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: Can you emulate everything?

Post by antus »

It seems from here viewtopic.php?f=42&t=6735#p99957 that if you had a real pcm, and a jimstim, you'd be able to read RAM while it was running over OBD. You could test or validate things that way. If you wanted to patch the OS you could probably add a poke routine to shove data in to a running PCM too. There is BDM which is designed for this, but I think because of the real time nature of the code and the hardware, it would not work or would not be useful.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
Post Reply