MEGAsquirt A place to collectively sort out this megasquirt gizmo

Tell me "Read the FAQ, N00b" - Compiling MS code?

Thread Tools
 
Search this Thread
 
Old 12-10-2007, 02:06 PM
  #1  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default 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.
AbeFM is offline  
Old 12-10-2007, 02:07 PM
  #2  
Tour de Franzia
iTrader: (6)
 
hustler's Avatar
 
Join Date: Jun 2006
Location: Republic of Dallas
Posts: 29,085
Total Cats: 375
Default

[secretly watching this thread]
hustler is offline  
Old 12-10-2007, 02:15 PM
  #3  
Senior Member
iTrader: (14)
 
brgracer's Avatar
 
Join Date: Nov 2004
Location: Ambler, PA
Posts: 1,275
Total Cats: 1
Default

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.
brgracer is offline  
Old 12-10-2007, 02:56 PM
  #4  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Originally Posted by brgracer
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
richyvrlimited is offline  
Old 12-10-2007, 02:58 PM
  #5  
Senior Member
iTrader: (14)
 
brgracer's Avatar
 
Join Date: Nov 2004
Location: Ambler, PA
Posts: 1,275
Total Cats: 1
Default

Originally Posted by richyvrlimited
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.
brgracer is offline  
Old 12-10-2007, 03:35 PM
  #6  
Elite Member
iTrader: (13)
 
cjernigan's Avatar
 
Join Date: Oct 2006
Location: Atlanta, GA
Posts: 8,091
Total Cats: 7
Default

This work for you?
http://www.bgsoflex.com/megasquirtembdown.html
cjernigan is offline  
Old 12-10-2007, 03:37 PM
  #7  
Ben
Supporting Vendor
iTrader: (33)
 
Ben's Avatar
 
Join Date: Jul 2006
Location: atlanta-ish
Posts: 12,659
Total Cats: 134
Default

Abe, just curious what changes/improvements you wish to make? Or is this a "for the fun of it" type project for you?
__________________
Chief of Floor Sweeping, DIYAutoTune.com & AMP EFI
Crew Chief, Car Owner & Least Valuable Driver, HongNorrthRacing

91 Turbo | 10AE Turbo | 01 Track Rat | #323 Mazda Champcar

Originally Posted by concealer404
Buy an MSPNP Pro, you'll feel better.
Ben is offline  
Old 12-10-2007, 04:23 PM
  #8  
Junior Member
 
arga's Avatar
 
Join Date: Aug 2006
Location: Ridgecrest, Ca
Posts: 306
Total Cats: 0
Default

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.
arga is offline  
Old 12-10-2007, 04:35 PM
  #9  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

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 is offline  
Old 12-10-2007, 04:41 PM
  #10  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

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
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 is offline  
Old 12-10-2007, 04:43 PM
  #11  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

Originally Posted by cjernigan
Hmmm, I thought so, but it's a MS-II, I knew something was wrong when I saw so many references to assembly. :-)
AbeFM is offline  
Old 12-10-2007, 04:48 PM
  #12  
Junior Member
 
arga's Avatar
 
Join Date: Aug 2006
Location: Ridgecrest, Ca
Posts: 306
Total Cats: 0
Default

Originally Posted by AbeFM
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.
arga is offline  
Old 12-10-2007, 05:02 PM
  #13  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

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 is offline  
Old 12-11-2007, 02:48 AM
  #14  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

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.

Last edited by AbeFM; 12-11-2007 at 03:22 AM.
AbeFM is offline  
Old 12-11-2007, 08:53 AM
  #15  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
Default

Originally Posted by AbeFM
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
Joe Perez is offline  
Old 12-11-2007, 12:24 PM
  #16  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

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
AbeFM is offline  
Old 12-11-2007, 02:27 PM
  #17  
Supporting Vendor
 
Matt Cramer's Avatar
 
Join Date: Sep 2006
Posts: 2,332
Total Cats: 67
Default

Originally Posted by AbeFM
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.
__________________
Matt Cramer
www.diyautotune.com
Matt Cramer is offline  
Old 12-11-2007, 03:15 PM
  #18  
Elite Member
Thread Starter
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

Originally Posted by Matt Cramer
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
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.
AbeFM is offline  
Old 12-12-2007, 09:23 AM
  #19  
Supporting Vendor
 
Matt Cramer's Avatar
 
Join Date: Sep 2006
Posts: 2,332
Total Cats: 67
Default

Originally Posted by AbeFM
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?
__________________
Matt Cramer
www.diyautotune.com
Matt Cramer is offline  
Old 12-12-2007, 12:06 PM
  #20  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
Default

Originally Posted by AbeFM
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.
Joe Perez is offline  


Quick Reply: Tell me "Read the FAQ, N00b" - Compiling MS code?



All times are GMT -4. The time now is 12:43 PM.