Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   MEGAsquirt (https://www.miataturbo.net/megasquirt-18/)
-   -   Tell me "Read the FAQ, N00b" - Compiling MS code? (https://www.miataturbo.net/megasquirt-18/tell-me-read-faq-n00b-compiling-ms-code-14664/)

AbeFM 12-10-2007 02:06 PM

Tell me "Read the FAQ, N00b" - Compiling MS code?
 
What do I need to do to get up and running for compiling and uploading my own (or other people's) code to the MS?

I have both Ubuntu and Vista, and a laptop with something terrible like win95 on it.

I'm not sure when I'll have to start compiling, and when I'll just be uploading code/tables other people wrote, but since I'm going to start soldering soon, I might as well spend the next day or two (putting off doing laundry by) setting up my computer so I don't have to do it later.

Thanks!
-Abe.

hustler 12-10-2007 02:07 PM

[secretly watching this thread]

brgracer 12-10-2007 02:15 PM

No compiling. Download the 1st file for all the software necessary http://www.msextra.com/manuals/MS_Ex...nual_Index.htm. IIRC it includes easytherm, but not 100% sure on that. There are also links further down for support tuning software like Megalogviewer/vexme. Don't know about ubuntu compatibility with linux, but it does work with vista. I'm assuming that you will be running the MS extra for fuel and spark like everyone else here who runs MS-I.

As for other people's maps. Everyone's MS has an *.msq file in it that is what people share, but it is for all settings so I wouldn't just load someone else's map into your car before making sure that things like inverted spark/overboost protection/etc... are the same as yours. You can always use a program like vexme to export/import just the spark/fuel maps.

When reading the manuals, it's easy to get overwhelmed as things sound much more complex than they really are, but once you get your car running, megatune/megalogviewer/VEanalyzer make much more sense and is pretty intuitive. I remember feeling kind of over my head while reading the manual, and when using the software live, it made MUCH more sense.

richyvrlimited 12-10-2007 02:56 PM


Originally Posted by brgracer (Post 184081)
No compiling. Download the 1st file for all the software necessary http://www.msextra.com/manuals/MS_Ex...nual_Index.htm. IIRC it includes easytherm, but not 100% sure on that. There are also links further down for support tuning software like Megalogviewer/vexme. Don't know about ubuntu compatibility with linux, but it does work with vista. I'm assuming that you will be running the MS extra for fuel and spark like everyone else here who runs MS-I.

As for other people's maps. Everyone's MS has an *.msq file in it that is what people share, but it is for all settings so I wouldn't just load someone else's map into your car before making sure that things like inverted spark/overboost protection/etc... are the same as yours. You can always use a program like vexme to export/import just the spark/fuel maps.

When reading the manuals, it's easy to get overwhelmed as things sound much more complex than they really are, but once you get your car running, megatune/megalogviewer/VEanalyzer make much more sense and is pretty intuitive. I remember feeling kind of over my head while reading the manual, and when using the software live, it made MUCH more sense.

Uhh dude, Abe is a bit more advanced than needing to know where to D/Load MegaTune from ;)

he wants to de-compile edit and then re-compile the firmware for his MS ;)

brgracer 12-10-2007 02:58 PM


Originally Posted by richyvrlimited (Post 184114)
Uhh dude, Abe is a bit more advanced than needing to know where to D/Load MegaTune from ;)

he wants to de-compile edit and then re-compile the firmware for his MS ;)

Whoops. Should have read the question better. :hs:

cjernigan 12-10-2007 03:35 PM

This work for you?
http://www.bgsoflex.com/megasquirtembdown.html

Ben 12-10-2007 03:37 PM

Abe, just curious what changes/improvements you wish to make? Or is this a "for the fun of it" type project for you?

arga 12-10-2007 04:23 PM

Here's a link to the latest beta d/l.
http://www.msextra.com/ms2extra/file...ta20071122.zip

Here's a link to the thread about the latest beta:
http://www.msextra.com/viewtopic.php?t=26715

If I remember right, everything is hard pathed to C:/msii, so create the directory then expand the zip there.

Look for the file "make.bat" and run it. I'm pretty sure you also need to install Cygwin (free) but that takes a long time to d/l so try make.bat w/o first.

Once you do a build, you'll create a .s13 file (maybe .s19, god my memory sucks). Copy that file up one directory level and run the download batch file w/ MS connected to d/l. The batch files gives you step by step instructions. It's straight forward.

Be sure your coils are not connected or you will fry them. Even after you flash, the default spark setting hold the coils hot so don't connect the them until you set the ignition settings to Miata specific values. You might want to verify w/ a multimeter or o-scope to be sure.

AbeFM 12-10-2007 04:35 PM

Ha, thanks for the vote of confidence, guys. I'm just not afraid, I wouldn't say I'm 'advanced'. Trying to be a little intelligent here and not reinventing any wheels, I really want to get up and running ASAP, reusing what's available in the community so I know I'm not doing anything dumb.

THEN yes, there's a lot I want to do. With/Like Arga, I want to run the OEM '99 sensors. An external box for voltage regulation seems easy enough, but I might want to write my own cruise control routine (easy enough I think if I put real cut out switches on things). I have three main goals:

1) A car with knock sensing, definable fuel & spark tables, maybe EBC. You know, an actual computer controlled turbo car that will do what I need it to stay together without running only 7 psi.

2) To help develop a 99+ "pnp" MS solution so people don't have to buy CAS sensors or give up features their car had stock just to get a real ECU in the car

3) To dink around with things like configurable water injection, wheel sensor or accelerometer based traction control, making my turn signals flash in new and exciting ways. Just anything a "computer in a car" could do, just one that has access to esoteric engine condition information.

So yeah. Pointing me to "MS101 for dummies" is excellent, I don't want to learn the hard way! But I'm also sure I'm going to look at something interesting before too long, certainly apprenticing under Arga with the starting/idling on an NB miata is something I want to do ASAP.

AbeFM 12-10-2007 04:41 PM

Thanks! That's exactly what I'm looking for. I'll probably want to steal your maps, too, although yours probably don't go too far into the 100-200 kpa range. :-)


Originally Posted by arga (Post 184152)
Be sure your coils are not connected or you will fry them. Even after you flash, the default spark setting hold the coils hot so don't connect the them until you set the ignition settings to Miata specific values. You might want to verify w/ a multimeter or o-scope to be sure.

My GOD that's the first thing I want to change. What do you do, swap out a transistor or something? I see this all over the place, and it seems a warning we shouldn't need. :-( Maybe I could put a relay in to cut power till a line gets pulled low. :-P But yeah, in the meantime, unplugging is fine I'm sure.

Sounds like windows is the development environment of choice then?

AbeFM 12-10-2007 04:43 PM


Originally Posted by cjernigan (Post 184136)

Hmmm, I thought so, but it's a MS-II, I knew something was wrong when I saw so many references to assembly. :-)

arga 12-10-2007 04:48 PM


Originally Posted by AbeFM (Post 184158)
3) To dink around with things like configurable water injection, wheel sensor or accelerometer based traction control, making my turn signals flash in new and exciting ways. Just anything a "computer in a car" could do, just one that has access to esoteric engine condition information.

MS has support for injector sequencing but I don't know anyone that's tried it. It could potentially be used to control WI. The down side is that MS w/o the sequencer board only has 2 injector outputs so your primary injectors would all have to fire at once as opposed to 2 separate banks like they currently do.

There was also going to be an expansion board for general purpose I/O. That might be a better solution. Not sure where that is, though.

AbeFM 12-10-2007 05:02 PM

that REALLY interests me. A long time ago it sounded like it was right around the corner. I'll tell you, I see more value in that than in the sequencer board. If you give up on backwards compatibility (something I feel is a big mistake in most development projects, start fresh if there's something to be gained!!), you could use the GPIO board to take over duties the MS is now doing, and then free up those channels for running 4 dedicated fuel injector lines from the CPU. That's enough for a sequential 4 or a banked 8. It kinda isn't ideal for V-6's but I mean, give up your 3 LEDs and one spare output and bingo! You've got 4 injectors.

You know, or not. Anyway, GPIO board is what really turns me on about all this - I want more ins and outs, ideally some analog.

AbeFM 12-11-2007 02:48 AM

http://www.jbperf.com/p&h_board/

heh - interesting. I gotta find out about the MS1x and the MS2x code, everything I see says the extra code is only for the MS1 but I know that's not right, maybe it's just the manuals?

Anyway, hmmm, 4 independant injector channels. It's enough to make a guy want to keep his staged injection. :-P I can't be the first person to see this, can I?

<edit>
Ok ok, I found it. Lots of MS-II stuff. Sounds like there's a lot missing, and a lot there. At least it's a bit easier to read now that there's a reason. :-)

Arga, got a link to that code again, I can't find it - the two versions of your ignition code for the OEM sensors.

Joe Perez 12-11-2007 08:53 AM


Originally Posted by AbeFM (Post 184380)

That board is really only needed by MSI owners running the hi-rez code. There's a variant of the MSnS-E code that increases the resolution of the injector channels from 0.1ms to 0.035ms, but in doing so loses the ability to do PWM injector control to drive low-impedance injectors directly.

MSII owners already have 0.001ms injector resolution and thus no need for an "HR" code variant, thus they will not lose their on-board PWM capability.

So that board is basically a standalone PWM injector driver. It takes a standard injector input and produces an output of equal duration but consisting of a brief peak period followed by a PWM current limited period. You could use it with any ECU, not just megasquirt. It's based on this IC from National: http://www.national.com/mpf/LM/LM1949.html

AbeFM 12-11-2007 12:24 PM

My take was that maybe you could run 4 channels by using the two outputs per channel of the MS-II and setting them to run 4 channels seperately, letting the driver board run the show.

What has me more concerned is the lack of EGT handling by the MS2-x

Matt Cramer 12-11-2007 02:27 PM


Originally Posted by AbeFM (Post 184504)
My take was that maybe you could run 4 channels by using the two outputs per channel of the MS-II and setting them to run 4 channels seperately, letting the driver board run the show.

What has me more concerned is the lack of EGT handling by the MS2-x

There's talk of the MS2/Extra V3.0 code being able to run four outputs using the peak & hold boards like what you describe.

The trouble with EGT is it's affected by a couple of other things like ignition timing and where you stick the probe. Using it for closed loop fuel correction's not going to be a good idea. It probably wouldn't be too hard to hack the code to log a single EGT channel, however.

AbeFM 12-11-2007 03:15 PM


Originally Posted by Matt Cramer (Post 184550)
There's talk of the MS2/Extra V3.0 code being able to run four outputs using the peak & hold boards like what you describe.

That's good, very exciting. Probably not something I'll start off with, but since I have oversized injectors I might be looking at it sooner than later.
Peak-and-hold isn't really something you should need to do in software.


Originally Posted by Matt Cramer (Post 184550)
The trouble with EGT is it's affected by a couple of other things like ignition timing and where you stick the probe. Using it for closed loop fuel correction's not going to be a good idea. It probably wouldn't be too hard to hack the code to log a single EGT channel, however.

Oh yeah - and it's not the fastest sensor in the world, tenths of a second aren't great. I have seen people monitor each cyl separately, though, which I think is not only trick but also great if you have individual fuel trims.

Matt Cramer 12-12-2007 09:23 AM


Originally Posted by AbeFM (Post 184573)
Oh yeah - and it's not the fastest sensor in the world, tenths of a second aren't great. I have seen people monitor each cyl separately, though, which I think is not only trick but also great if you have individual fuel trims.

It is quite useful for that. However, you'd run out of processor inputs with the current hardware, so you'd be better off using an external device (maybe an Innovate TC-4) to measure your exhaust temperatures. If you're reprogramming a Megasquirt, I wonder if you could write a routine for interfacing with Innovate's serial protocol?

Joe Perez 12-12-2007 12:06 PM


Originally Posted by AbeFM (Post 184504)
My take was that maybe you could run 4 channels by using the two outputs per channel of the MS-II and setting them to run 4 channels seperately, letting the driver board run the show.

Nay. Look at the schematic here: http://www.jbperf.com/p&h_board/P&H_board_schem.jpg

It's four completely separate driver channels. Output INJ1 is driven by U1, which is triggered by input 1. Output INJ2 is driven by U2, triggered by input 2, and etc... There is no switching logic at all, this board is just a simple input follower.

A thought however- I don't know what the cam sensor on an NB outputs. If you guys get one pulse per cam revolution (indicating #1 TDC only) instead of two pulses per cam revolution like us NA'ers, then it would be trivial to build a circuit to steer the pulses from the MS to the correct pair of injector drivers, based on the CAS indication.

BTW- what EGT sensor are you guys using? Mine is slower than hell, no possible way it could be used for fuel tuning- if I floor it on the highway, it takes a couple of seconds to see the change in EGT.


All times are GMT -4. The time now is 05:55 AM.


© 2024 MH Sub I, LLC dba Internet Brands