After my adventure getting my NB Miata running on Speeduino, I thought I'd compile everything I've learned into one thread. I'll be posting board layouts soon for a plug-in adapter board for the 0.4, but for now, this is simply a rough guide on how to make everything work.
Info is subject to change. My car is a 1998 (early UK-model) NB. Others may be different.
Gratuitous shot of the setup for my car. Right now I've built a little harness to break out the 64 pin connector to a DB25 plug for ease of wiring.
What you will need
- A Miata
- A Speeduino - this post is specific to the v0.4.3 board but I'm sure it could be useful to 0.3 users as well, although the wiring to the board will be different
- A ULN2803 chip for the low-current outputs
- A 64-pin connector - this is a TE CONNECTIVITY .040/.070 MULTILOCK, part number 174518-7
Speeduino build and jumper settings
- Build your board as per the BOM for a 2-channel setup.
- I substituted R39 and R40 pullups for 2.2k (reason: a commonly available input noise filter circuit for NB miatas for another well-known aftermarket ECU uses 2.2k pullups); this may not be necessary.
- Unless your setup specifically requires it (i.e for water/meth, nitrous), you do not need to populate the 3rd and 4th high current outputs, so you can omit: R55, R56, R57, R58, Q5, Q6.
- Do the ULN2803 mod as described here (picture below, but read the linked post) - you will need this to drive low current outputs such as the fan and fuel pump relays and the tachometer.
- For the tachometer output, solder a 2.2k pullup resistor to IDC40 pin 16 (ULN2803 pin 14) and connect the other end to +12v. (Forthcoming adapter board will have this resistor built in).
Set JP2 and JP3 to 'Hall'
JP4 and JP5 (pullups for cam/crank inputs) should be installed
Set JP1 (ignitor out voltage) to 5v
Firmware loading and Configuration in TunerStudio
(Base map will be posted as soon as I'm happy with it)
You will need the latest development firmware from Github to get the new decoder [thanks Noisymime!] (as of 01/09/17, I'm sure this will find its way into the "stable" build very soon).
In Trigger Setup: select decoder "Miata 99-05"
Set Trigger Edge and Secondary Trigger Edge both to "Trailing" (edited 3/9/17 - leading edge seems to cause extra timing jitter)
Trigger Filter set to 'Weak'
Trigger Angle: 5 degrees seems good for my car (TBC), you may/will need to adjust this using a timing light once the car is running.
Spark outputs trigger on: Going Low (very important, get this wrong and your coils will fry)
It seems to like a 400hz PWM frequency for the idle valve (lower frequencies make the valve buzz loudly) but this means the usable range is somewhere between 70 and 100% modulation, anything below that is 'off'. I have not yet managed to get closed loop working yet but open loop is OK-ish.
Fuel pump: pin 43
Thermo Fan: board default
Tach Output: pin 45
Wiring of 64-pin connector to board
The 64-pin connector is pinned as below. (Found this image over on Miataturbo wiki, hopefully it's OK to reproduce here).
Ignore the labels on the diagram, this is just to show how the pin numbers correspond to actual positions on the connector.
And here is how I've wired it on my car. Warning: others may vary. If in doubt, trace the wires through with a multimeter!
The fuel pump relay (marked red) definitely needs checking before you wire it up, on my car it was 3P but according to the wiring diagram it should be 3N. I can confirm that this pin has been 3P on two '98 year, UK model mk2 cars, so it might be either a 98 thing or a UK model thing
As also previously mentioned, I'll be coming through with a board layout for an adapter board very soon, but if you're a masochist and want to wire this up yourself, hopefully this will help.
CORRECTION 14/01/18: ALSO WIRE 2I (5V REF) TO IDC PIN 28
These cars have an externally regulated alternator. You need to build an alternator control circuit. Again, this will be on the adapter board, but if you want to build it now, you can use my Eagle schematic/board layout (attached). This is designed to be etched on a single sided 100mm wide PCB that will fit in the case above the Speeduino.
VR1 is a TL431. Set the trimpot to 48.7k. You can bench test this board by connecting the +12v and gnd to a bench supply and watching the output wire with a multimeter; increase the bench supply voltage until the output goes low and that's the voltage that your alternator will regulate at (ish). When wiring it up, connect PAD1 ('FIELD') to the 1O terminal on the ecu connector. Be careful with this circuit, get it wrong and you could cause expensive damage to your car's electrical system (and the batteries aren't cheap either). I am honestly not sure where this circuit first originated and whose it is, so if it's your circuit please feel free to tell me so I can update this
Note about VICS
While the VICS is wired to the high-current 2 output (ordinarily for boost control) I haven't yet figured out a simple way to trigger it. Ideally it would be nice to add a simple RPM dependent switch into the code. I will look at doing this soon.
That's it for now. I will add more info as I remember and will update this post as I go. Hopefully this is useful to someone