Bulk import

This commit is contained in:
Josh Stewart 2020-01-06 12:36:28 +11:00 committed by GitHub
parent ad48c48f9c
commit c30b36fe18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 2262 additions and 0 deletions

46
3rd_party.md Normal file
View File

@ -0,0 +1,46 @@
3rd Party Boards
================
3rd party boards fall into two main categories, Alternative Speeduino mainboards and Accessory boards.
Alternative Speeduino Mainboards
================================
### NO2C or No Overhang Two Channel
By Weaver Markel, aka turboedge
### What is it?
NO2C is the smallest, fully functional, single board, Arduino MEGA shield made for Speeduino. The board is no bigger than the MEGA itself. Originally intended for, but not limited to applications where space is limited. These may include ATVs, motorcycles, karts, lawnmowers, and other power equipment. As you might guess by the title, it is capable of driving two injector and two ignition channels. If desired the channels can be split to drive two injectors and two coil drivers each. Some versions of the NO2C can accept a daughter board that allows more channels and other features.
More information [NO2C for Speeduino](NO2C_for_Speeduino "wikilink")
Accessary Boards
================
dxControl-GPIO for Speeduino , A GPIO Controller for Speeduino
--------------------------------------------------------------
By Darren Siepka, aka Dazq
### What is it?
dxControl-GPIO are a family of multipurpose general programmable input and output modules that can be used both in conjunction with the Speeduino engine ECU or standalone. The modules are programmed via Tunerstudio either via the serial port or over the integrated CanBus network(certain variants only)
The modules can use several different processor board types, including different arduino, teensy and stm32.
IO operations are programmed with logic, < ,>,= and bitwise AND . some variants offer 2 or even 3 connecting logic conditions.
More information [dxControl-GPIO](dxControl-GPIO "wikilink")
DxControl-Gears , A Gearbox Controller for Speeduino
----------------------------------------------------
By Darren Siepka, aka Dazq
### What is it?
dxControl-Gears is a controller for electronically controlled automatic gearboxes, designed to accompany Speeduino. It is a custom development of the dxControl-GPIO code .
More information [dxControl-Gears](dxControl-Gears "wikilink")

159
Bluetooth.md Normal file
View File

@ -0,0 +1,159 @@
Bluetooth Wireless Option
-------------------------
<center>
<img src="http://i.imgur.com/KgmM8nL.png" height="100" /><img src="http://i.imgur.com/NjmX3qu.png" height="100" /><img src="https://raw.githubusercontent.com/speeduino/wiki/master/Speeduino%20logo_sml.png" height="100" />
</center>
### Minimum-Money Hardware
The Mega 2560 communicates via a USB-to-serial connection for downloading of the Speeduino firmware, and also for communication during operation with monitoring, tuning, and logging programs such as TunerStudio and MegaLogViewer. Once the Speeduino firmware is loaded, Speeduino can also communicate via a properly re-programmed Bluetooth module serial connection, known as serial port profile (SPP). There are a number of ways to accomplish this, and the following demonstrates using an inexpensive [HC-series bluetooth module](http://www.ebay.com/sch/i.html?_odkw=hc+bluetooth+-%28interface%2Cbase%2Cbare%29&_sop=15&LH_BIN=1&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xhc+bluetooth+-%28interface%2Cbase%2Cbare%29+backplane.TRS0&_nkw=hc+bluetooth+-%28interface%2Cbase%2Cbare%29+backplane&_sacat=0) for a direct connection to the Mega board.
------------------------------------------------------------------------
''Note: Speeduino and TunerStudio communicate at 115200 bps baud rate. Most any wireless serial device from Bluetooth to Satphone will work if programmed to the proper communications speed. Some slower systems (e.g., cheap short-range 433MHz radio) can work, but may not transmit or receive quickly enough for high-speed data logging.
*Note: Loading firmware by Bluetooth is possible, but requires specific and somewhat involved procedure, or a more expensive and [specific type of Bluetooth module](https://www.adafruit.com/products/1588) that can accomplish resetting for upload — neither of which is within the scope of this basic overview. Additional information is on the Speeduino Forums.*
*Note: Using bluetooth bypasses the USB serial converter, allowing Arduino Mega versions with non-FTDI UART serial chips to connect to TunerStudio and other serial programs cross-platform without special drivers or setup. The Mega demonstrated here is a CH340 version.*
------------------------------------------------------------------------
### Bluetooth Types
This method of using Bluetooth (BT) communications only requires an HC-series BT module, and a wiring connection. The BT module in this case is an HC-05, HC-06, HC-07 or HC-09, mounted on an interface board (“backplane”, “backboard”, "breakout", etc) operating in Slave mode. As slave-only modules are simpler to re-program, the example described here is an **HC-06** slave-only module on a **JY-MCU v1.02** board:
<center>
<img src="http://i.imgur.com/siuxlXg.png" height="200" />
</center>
### The Board
The purpose of the interface board is to allow operation from any voltage of 3.6 to over 6 volts, permitting powering from the Mega's 5V pins, as well as regulated voltage on the Tx (transmit) and Rx (receive) lines. While an HC BT without interface board may be used, the power must be 3.3 volts, and divider or regulation circuits must also be made and used on the TX and RX lines to drop voltage from 5-volt TTL to a safe level for the bare BT. Using a module with the interface board solves these problems, and also provides an LED indicator and connection pins.
### Connections
#### Pin Connections
The BT module connects to the Mega through the TX0 and RX0 pins, and the 5V and GND (ground) pins. The Mega connects to the BT module as follows:
**`Mega_______BT`**
`TX0------>RXD`
`RX0<------TXD`
`5V--------VCC`
`GND-------GND`
<center>
<img src="http://i.imgur.com/AJooEMu.png" height="200" />
</center>
While the HC interface module can connect and functions when connected to the Mega's 3.3V pin, the module specifies 3.6V minimum for proper regulator operation, and therefore the 5V connection is suggested. There are several locations on the Mega board to source 5V and ground, and the most obvious are the standard marked power pins in this example. The connector shown was scavenged from an old desktop computer, and re-purposed for connecting the BT. The wire colors do not matter, and must only make the proper connections:
<center>
<img src="http://i.imgur.com/tviZHpy.png" height="200" />
</center>
### Board Attachment
The connector wires are soldered directly to the Mega's pins on the bottom of the board. It is imperative that a strain relief be used to prevent pulling on the soldered connections, as they are relatively weak. In this example a 'zip tie' is used though one of the Mega holes and around the wires as a strain relief:
<center>
<img src="http://i.imgur.com/FghgQsE.png" height="200" />
</center>
The wires are left long enough to allow the antenna end of the BT to protrude from the case end plate for good signal range and better BT speeds, and also allow easy disconnection and reconnection for Speeduino access in the enclosure.
After proper [reprogramming](Bluetooth#Reprogramming_the_Bluetooth_Module "wikilink"); the BT module LED glowing continuously indicates connection, and the glowing Mega TX and RX lights are active, sending and receiving info to TunerStudio:
<center>
<img src="http://i.imgur.com/4XLIyA6.png" height="200" />
</center>
### Phones / Tablets
With an active Bluetooth connection, smart phones and tablets can talk to Speeduino. Android phones and the free [MSDroid](https://play.google.com/store/apps/details?id=com.msdroid) dash and logging app are one example, as is the [Shadow Dash](http://www.tunerstudio.com/index.php/shadowdashmsmenu) app from the makers of TunerStudio.
Once the [BT module reprogramming](http://speeduino.com/wiki/index.php/Connecting_to_TunerStudio#Reprogramming_the_Bluetooth_Module) is completed in the following section; a scan by your phone or tablet should have your Speeduino appear as an available device with the new name you assigned it. In the Android example below, there is one Speeduino already paired by Bluetooth, and it has found a second Speeduino, called "Speeduino-v0.4":
<center>
<img src="http://i.imgur.com/uKQptUV.png" height="200" />
</center>
When Speeduino-v0.4 is selected, the system prompts for the security PIN to be entered:
<center>
<img src="http://i.imgur.com/qy104pQ.png" height="200" />
</center>
When validated, the new Speeduino-v0.4 appears in the list of paired devices:
<center>
<img src="http://i.imgur.com/qFHzdg6.png" height="200" />
</center>
In this example using MSDroid; after loading the *speeduino.ini* file into MSDroid's ini folder, and "Connect to ECU" is selected in Settings, monitoring, tuning, or logging is available:
<center>
<img src="http://i.imgur.com/za7wptB.png" height="200" />
</center>
### Reprogramming the Bluetooth Module
The module is usually supplied with generic settings. The name it broadcasts is non-descriptive, the PIN security code is commonly 0000 or 1234 with obvious low security, and unusable 9600 bps speed is typical. These settings should be changed for proper operation and security. The module can be reprogrammed to “Speeduino”, change the PIN number to 9876 (or any other) for security, and set the speed to the required 115200 bps in the following example.
<center>
<img src="http://i.imgur.com/1taXGO8.png" height="200" />
</center>
#### Interface
There are two common terminal emulators used to accomplish this. Both use a serial interface, such as the Arduino [IDE serial monitor](https://www.arduino.cc/en/Guide/Environment#toc12), or programs appropriate for your PC's OS, such as [HTerm](http://www.der-hammer.info/terminal/), [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/), [TeraTerm](http://ttssh2.osdn.jp/index.html.en), etc.).
#### UARTs
The first type of terminal emulator is an inexpensive UART module acting as a [USB-to-TTL serial converter](http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_sop=15&LH_ItemCondition=1000&_nkw=usb%20ttl&rt=nc&LH_BIN=1&_trksid=p2045573.m1684). This module connects to the BT module in the same way as the Mega:
<center>
<img src="http://i.imgur.com/xZ3eKx2.png" height="200" />
</center>
The second type tested to work properly is by using the UART on-board an [Arduino](http://www.princetronics.com/arduino-uno-as-usb-to-serial-ttl-converter/) as a terminal emulator. [This method](http://alselectro.wordpress.com/2014/10/21/bluetooth-hc05-how-to-pair-two-modules/) uses either a blank sketch, or a jumper from the RESET pin to a GND pin to hold the Arduino in reset mode, allowing straight-through serial communications to pins TX0 and RX0. Note this method uses different connections to the BT, using TX-to-TX and RX-to-RX, only for programming with AT commands. Normal BT operation still requires the connections shown earlier. The module type may also require an additional jumper.
#### Commands
Once the USB-to-TTL communication is established to the BT module, the HC-06 commands to re-program are:
**`Send_________________Response`**
`AT`<enter>`---------------OK`
`AT+NAMESpeeduino-----OKSetname`
`AT+PIN9876-----------OKSetPIN`
`AT+BAUD8-------------OK115200`
Other module types may require different commands to perform the reprogramming. For example some newer HC-06 will accept "AT" by itself but give errors for the other commands. In those cases try the these variations: AT+NAME=Speeduino, AT+PSWD="9876", AT+UART=115200,0,0.
The module should now be ready to connect to Speeduino and communicate with the new name, PIN, and baud rate.
------------------------------------------------------------------------
------------------------------------------------------------------------
#### Bluetooth Range and Speed
Even with the antenna exposed, placement under the dash or behind vehicle structure may block the signal excessively, and an extension can be used to expose the BT module:
<center>
<img src="http://i.imgur.com/jmcByIf.png" height="200" /><img src="http://i.imgur.com/XT7HH7c.png" height="200" />
</center>
An extension is easily made with common stranded-wire (never solid wire!) 4-conductor cable and simple connectors. If shielded cable is used, only ground the shielding to the GND wire at the Mega-end of the cable.
The extension can also be securely and quickly connected at the enclosure by using a common 4-pin connector or similar:
<center>
<img src="http://i.imgur.com/XSD7Ror.png" height="200" />
</center>
------------------------------------------------------------------------
------------------------------------------------------------------------

22
Board_overview.md Normal file
View File

@ -0,0 +1,22 @@
**THIS PAGE IS A WORK IN PROGRESS. FURTHER DETAILS TO COME!**
There are currently 2 families of Speeduino boards available, the v0.3 line and the v0.4 line. These boards were designed to fit 2 different use cases and serve different purposes. The v0.4 line of boards is not necessarily newer/better than the v0.3, the 2 share largely the same features and capabilities. The differences are in how these are intended to be used.
As a very rough indication, the v0.3 line is best suited for retrofitting of fuel injection. The screw terminals make it simpler to connected to a bare wiring loom The v0.4 boards are intended primarily to replace OEM ECUs and hence are designed to be simpler for connector with existing connectors
Feature Compare
===============
| | v0.3 | V0.4 |
|---------------------------|---------------------------------------|--------------------------------------------------------|
| Board Dimensions | 13.8cm X 10cm | 10cm X 10cm |
| Injector Channels | 4 | 4 |
| Ignition Channels | 4 | 4 |
| Connectors | Screw terminals | Single IDC40 (IDE) Connector Screw terminals for power |
| Analog Inputs (Protected) | TPS, Coolant, Inlet Air Temp, O2, MAP |
| Other outputs | 4 high current low side drivers |
| Stepper board socket | N | Y |
| I2C (Proto area) | Y | Y |
| SPI (Proto area) | Y | N |
| | | |

View File

@ -0,0 +1,144 @@
With the goal of maximum simplicity in mind, the process of compiling and installing the firmware is reasonably straightforward.
Latest Stable Firmware
----------------------
- **Date:** April 4th 2019
- **Details:** See <https://speeduino.com/forum/viewtopic.php?f=13&t=2701>
Installation - Easy Method
--------------------------
The simplest method of installing the Speeduino firmware onto a standard Arduino Mega 2560 is with the SpeedyLoader utility. SpeedyLoader takes care of downloading the firmware and installing it onto an Arduino without the need to manually compile any of the code yourself. You can choose the newest firmware that has been released, or select from one of the older ones if preferred. SpeedyLoader will also download the INI file for the firmware you choose so it can be loaded into your TunerStudio project.
- **Windows:** [32-bit](https://github.com/speeduino/SpeedyLoader/releases/latest/download/SpeedyLoader-ia32.exe) / [64-bit](https://github.com/speeduino/SpeedyLoader/releases/latest/download/SpeedyLoader-x64.exe)
- **Mac:** [SpeedyLoader.dmg](https://github.com/speeduino/SpeedyLoader/releases/latest/download/SpeedyLoader.dmg)
- **Linux:** [SpeedyLoader.AppImage](https://github.com/speeduino/SpeedyLoader/releases/latest/download/SpeedyLoader.AppImage) (Will need to be made executable after downloading)
- **Raspberry Pi** [SpeedyLoader.AppImage](https://github.com/speeduino/SpeedyLoader/releases/latest/download/SpeedyLoader-armv7l.AppImage)
- Linux / RaspberryPi versions require libusb libraries to be installed. EG if on Debian/Ubuntu:
sudo apt-get install libusb-1.0-0 libusb-0.1-4:i386
Once the firmware is installed on the board, see [Connecting to TunerStudio](Connecting_to_TunerStudio "wikilink") for more details on how to configure TunerStudio
Manually Compiling
------------------
If you want to compile the firmware yourself, or make any code changes, then the source of both the releases and the current development version is freely available. Note that manually compiling the firmware is **NOT** required to install Speeduino, the easiest (and recommended for most users) method is using SpeedyLoader as described above.
### Requirements
- A Windows, Mac or linux PC
- One of the following:
- [The Arduino IDE](http://arduino.cc/en/Main/Software). Current minimum version required is 1.6.7, although a newer version is recommended.
- [PlatformIO](http://platformio.org/). Can be downloaded from <http://platformio.org/platformio-ide>
- A copy of the latest Speeduino codebase. See below.
- A copy of [TunerStudio](http://www.tunerstudio.com/index.php/downloads) to test that the firmware has uploaded successfully
### Downloading the firmware
There are two methods for obtaining the Speeduino firmware:
1. Regular, stable code drops are produced and made as releases on Github. These can be found at: <https://github.com/noisymime/speeduino/releases>
2. If you want the latest and greatest (And occasionally flakiest) code, the git repository can be cloned and updated. See <https://github.com/noisymime/speeduino>
#### Older firmware releases
If required, older firmware releases and details can be found at [Firmware History](Firmware_History "wikilink")
### Compiling the firmware
- Start the IDE, select *File &gt; Open*, navigate to the location you downloaded Speeduino to and open the **speeduino.ino** file.
- Set the board type: *Tools &gt; Board &gt; Arduino Mega 2560* or Mega ADK (This is the only board currently supported)
- Click the **Verify** icon in the top left corner (Looks like a tick) <img src="http://i.imgur.com/FKMDHoC.png?1" width="30" height="30" />
At this point you should have a compiled firmware! If you experienced a problem during the compile, see the [Troubleshooting](http://speeduino.com/wiki/index.php?title=Compiling_and_Installing_Firmware&action=edit&section=4#Troubleshooting) section below.
This video walks through the whole process of installing the firmware on your Arduino from scratch:
<center>
<embedvideo service="youtube">AX9URou4JTs</embedvideo>
</center>
#### Optional (But recommended)
There is an option available for changing the compiler optimization level, which can improve . By default, the IDE uses the -Os compile option, which focuses on producing small binaries. As the size of the Speeduino code is not an issue but speed is a consideration, changing this to -O3 produces better results (Approximately 20% faster, with a 40% larger sketch size) To do this, you need to edit the platform.txt file:
- Make sure the Arduino IDE isn't running
- Open the platform.txt file which is in the following locations:
- On Windows: c:\\Program Files\\Arduino\\hardware\\arduino\\avr
- On Mac: /Applications/Arduino/Contents/Resources/Java/hardware/arduino/avr/
- On Linux:
- On the following 3 entries, change the Os to be O3:
- compiler.c.flags
- compiler.c.elf.flags
- compiler.cpp.flags
- Save the file and restart the Arduino IDE
**Note:** This is NOT required if using PlatformIO, the above optimisation is applied automatically there
### Installing
Once you've successfully compiled the firmware, installation on the board is trivial.
- Plug in your Mega 2560 to a free USB port
- If you're running an older version of **Windows** and this is the first time you've used an Arduino, you may need to install drivers for the Arduino serial chip (USB-UART or "USB adapter chip").
<img src="http://i.imgur.com/CkVOai2.png" width="400" />
Most official boards and many non-official versions use the ATMega16U2 or 8U2, whereas many of the Mega2560 clone boards utilize the CH340G IC. Both types work well. The serial chips can generally be identified by appearance:
ATMega16U (square IC) - drivers included in Windows, MacOS and Linux:
<img src="http://i.imgur.com/epoIiIm.png" width="200" />
or
WCH CH340G (Rectangular IC) - uses "CH341" drivers from [WCH](http://www.wch.cn/downloads/file/65.html) for Windows:
<img src="http://i.imgur.com/bB2DqNW.png" width="200" />
WCH-original CH340/CH341 drivers for other systems (Mac, Linux, Android, etc) may be found [here](http://www.wch.cn/downloads/CH341SER_ZIP.html).
- In Arduino IDE; select the Mega2560: *Tools &gt; Board*
- Select your system's serial port to upload: *Tools &gt; Serial Port*
- Hit the *Upload* button from the top left corner (Looks like an arrow point to the right) <img src="http://i.imgur.com/NgSMarQ.png" width="30" height="30" />
Assuming all goes well, you should see the IDE message that avrdude is done, similar to this:
<img src="http://i.imgur.com/iBRSq5t.png" />
### Verifying Firmware
The firmware is now loaded onto your board and you are now able to move onto [Connecting to TunerStudio](Connecting_to_TunerStudio "wikilink").
Optionally, you may perform a verification of the firmware by using the Arduino IDE's Serial Monitor. This can be started by selecting 'Serial Monitor' from the Tools menu.
In the window that appears, enter a capital "S" (no quotes) and press *Enter*. The Mega should respond with the year and month of the code version installed (xxxx.xx):
Speeduino 2017.03
**NOTE**: Ensure the baud rate is set to 115200
You can also enter "?" for a list of queries from your Mega.
### Troubleshooting
#### Incorrect Arduino board selected
If you see the following (or similar) errors when trying to compile the firmware and the solutions:
scheduler.ino:317:7: error: OCR4A was not declared in this scope
scheduler.ino:323:8: error: TIMSK5 was not declared in this scope
scheduler.ino:323:25: error: OCIE4A was not declared in this scope
You may have the wrong kind of Arduino board selected. Set the board type by selecting *Tools &gt; Board &gt; Arduino Mega 2560* or Mega ADK
#### Entire Speeduino project is not opened
The following can occur if you have only opened the speeduino.ino file rather than the whole project.
`speeduino.ino:27:21:` `fatal` `error:` `globals.h:` `No` `such` `file` `or` `directory`
Make sure all the files are contained within the same directory, then select File-&gt;Open and find the speeduino.ino file. If you have opened the project correctly, you should have multiple tabs along the top:
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/speeduinoIDE.png" width="60%" />

36
Configuration_Index.md Normal file
View File

@ -0,0 +1,36 @@
- **Settings Menu**
- [Engine Constants](Engine_Constants "wikilink")
- [Injector Characteristics](Injector_Characteristics "wikilink")
- [Trigger Setup](Trigger_Setup "wikilink")
- [IAT Density](IAT_Density "wikilink")
- [Reset Control](Reset_Control "wikilink")
- **Tuning Menu**
- [Acceleration Wizard](Acceleration_Wizard "wikilink")
- [AFR/O2](AFR/O2 "wikilink")
- [Rev Limits](Rev_Limits "wikilink")
- [Flex Fuel](Flex_Fuel "wikilink")
- [Staged Injection](Staged_Injection "wikilink")
- **Spark Menu**
- [Spark Settings](Spark_Settings "wikilink")
- [Dwell](Dwell "wikilink")
- [IAT Retard](IAT_Retard "wikilink")
- **Starting/Idle Menu**
- [Cranking](Cranking "wikilink")
- [Warmup](Warmup "wikilink")
- **Idle control**
- [Idle](Idle "wikilink")
- **Accessories Menu**
- [Thermo fan](Thermo_fan "wikilink")
- [Launch Control and Flat shift](Launch_Flatshift "wikilink")
- [Fuel pump](Fuel_pump "wikilink")
- [Boost Control](Boost_Control "wikilink")
- [VVT](VVT "wikilink")
- [Tacho](Tacho "wikilink")
- [Secondary Serial Interface](Secondary_Serial_IO_interface "wikilink")
- [External Auxilary input channel configuration](Auxillary_IO_Configuration#How_to_Configure_to_use_a_External_Data_Source "wikilink")
- [Local Auxilary input channel configuration](Auxillary_IO_Configuration#How_to_Configure_to_use_a_Local_MCU_pin "wikilink")
<!-- -->
- Tools Menu
- [Sensor Calibration](Sensor_Calibration "wikilink")

View File

@ -0,0 +1,42 @@
Configuring TunerStudio Project Properties
------------------------------------------
The menu option for the project properties page can be found here <img src="project_properties_select.jpg" title="fig:project_properties_select.jpg" alt="project_properties_select.jpg" width="400" />
Once opened this page will be seen. <img src="project_properties.jpg" title="fig:project_properties.jpg" alt="project_properties.jpg" width="350" />
Settings Tab
------------
### Temperature Display
Options are :
- Fahrenheit(Default)
- Celsius
### Fueling Algorithms
Options are :
- Speed Density Fueling Algorithm (default)
- Alpha-N Fueling Algorithm
### Enable_hardware_test
Default option is disabled. If Enabled an additional Tab will appear on the tuning page <img src="hardware_test_tab.jpg" title="fig:hardware_test_tab.jpg" alt="hardware_test_tab.jpg" width="200" /> Clicking on this will open further options <img src="hardware_test_output_option.jpg" title="fig:hardware_test_output_option.jpg" alt="hardware_test_output_option.jpg" width="200" />
- Output Testing
[`Hardware` `test` `page`](Hardware_testing_page "wikilink")`.`
- Input Testing
### CAN_COMMANDS
Default option is disabled
Can Devices Tab
---------------
<img src="can_devices_tab.jpg" title="can_devices_tab.jpg" alt="can_devices_tab.jpg" width="350" />

View File

@ -0,0 +1,57 @@
Tuner Studio is the recommended tuning interface for the Speeduino. It runs on Windows, Mac and linux and provides configuration, tuning and logging capabilities.
Once you have the firmware compiled and uploaded to your Arduino, you're ready to setup Tuner Studio in order to configure and monitor it. If you haven't yet compiled and uploaded the firmware, refer to the [Compiling and Installing Firmware](Compiling_and_Installing_Firmware "wikilink") page.
Downloading Tuner Studio
------------------------
If you haven't already, grab a copy of Tuner Studio from: [1](http://www.tunerstudio.com/index.php/downloads)(http://www.tunerstudio.com/index.php/downloads) Tuner Studio is available for Windows, Mac and linux and will run on most PCs as it's system requirements are fairly low.
The current minimum version of TunerStudio required is 3.0.7, but the latest version is usually recommended.
If you find Tuner Studio to be useful, please consider paying for a license. This is a fantastic program from a single developer that rivals the best tuning software in the world, it's worth the money.
Setting up your project
-----------------------
### Create new project
When you first start TunerStudio, you'll need to setup a new project which contains the settings, tune, logs etc. On the start up screen, select 'Create new project'
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_1.png" width="60%" />
Give you project a name and select the directory you want the project to be stored in. Tuner Studio then requires a firmware definition file in order to communicate with the arduino. Tick the 'Other / Browse' button.
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_2.png" width="40%" />
Then browse to the Speeduino source directory, enter the reference subfolder and select speeduino.ini file
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_3.png" width="40%" />
### Configuration options
Set the configuration parameters for your project. These can be changed any time later on, so don't worry if you don't have them at this time.
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_4.png" width="40%" />
### Comms settings
Select your comms options. The exact port name will depend on which operating system you are running and this will be the same as in the Arduino IDE. Baud rate should be 115200.
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_5.png" width="40%" />
### Load base tune
Once the project is created, you'll need to load in a base tune to ensure that all values are at least somewhat sane. Failure to do this can lead to very strange issues and values in your tune.
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_6.png" width="40%" />
In the Speeduino reference directory, you will find the base tune file to be opened:
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/TS_7.png" width="40%" />
And that's it! Tuner Studio should now attempt to connect to the Arduino and show a realtime display of the ECU.
------------------------------------------------------------------------
------------------------------------------------------------------------

View File

@ -0,0 +1 @@
1. REDIRECT [Configuring_TunerStudio](Configuring_TunerStudio "wikilink")

24
Decoders.md Normal file
View File

@ -0,0 +1,24 @@
Speeduino supports an ever growing number of crank and cam decoders and trigger wheels. This includes some of the more common OEM setups as well as those favoured in the aftermarket (Such as the missing tooth wheels).
The list below includes all those that are currently supported. They each lead to a page with details on using the decoder (These pages are a Work in Progress)
| Decoder | Status | Applications / Description |
|-------------------------------------------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------|
| [Missing Tooth](Missing_Tooth "wikilink") | Complete | A crank wheel with 1 or more 'missing' teeth |
| [Missing Tooth (cam)](Missing_Tooth_(cam) "wikilink") | Complete | A camshaft or distributor wheel with 1 or more 'missing' teeth at half-crank speed |
| [Dual Wheel](Dual_Wheel "wikilink") | Complete | Two signals combined from two different wheels |
| [Basic Distributor](Basic_Distributor "wikilink") | Complete | Untimed pulses that are the equivalent of a tach or distributor pulse |
| [GM 7X](GM_7X "wikilink") | Untested | Multi tooth pulse |
| [4G63](4G63 "wikilink") | Complete | As used on many 4 cylinder Mitsubishis and NA/NB Miata / MX-5. Also supports the 6 cylinder variation of this pattern (Eg 6g72) |
| [GM 24X](GM_24X "wikilink") | Untested | Commonly used on GM LS1 V8 |
| [Jeep 2000](Jeep_2000 "wikilink") | Complete | 6 Cylinder Jeep engines from '91 to 2000 |
| [Audi 135](Audi_135 "wikilink") | Complete | Audi engines with 135 pulses-per-revolution |
| [Honda D17](Honda_D17 "wikilink") | Complete | Honda 4 cylinder D17 engine |
| [Miata 99](Miata_99 "wikilink") | Complete | 1.8L Miata/MX5 from '99 to '00 |
| [Non-360](Non-360 "wikilink") | Complete | A variation of the dual wheel decoder that can be used with tooth counts that do not divide evenly into 360 |
| [Nissan 360](Nissan_360 "wikilink") | In progress | 360 tooth cam wheel used in many 4 and 6 cylinder engines. |
| [Subaru 6/7](Subaru_6/7 "wikilink") | Testing underway | Subaru engines using the 6 tooth crank wheel + 7 tooth cam wheel arrangement |
| [Daihatsu +1](Daihatsu_+1 "wikilink") | Complete | 3+1 and 4+1 patterns used on 3 and 4 cylinder Daihatsu engines |
| [Subaru 36-2-2-2](Subaru_36-2-2-2 "wikilink") | Complete | A 30 tooth wheel with three strategically placed big gaps |
All signals need to be conditioned to a 3.3v - 5v dc square wave before being used by the firmware.

641
DxControl-GPIO.md Normal file
View File

@ -0,0 +1,641 @@
dxControl-GPIO, A GPIO Controller for Speeduino
===============================================
By Darren Siepka
### What is it?
dxControl-GPIO are a family of multipurpose general programmable input and output modules that can be used both in conjunction with the Speeduino engine ECU or standalone. The modules are programmed via Tunerstudio either via the serial port or over the integrated CanBus network(certain variants only)
The modules can use several different processor board types, including different arduino, teensy and stm32.
Io operations are programmed with logic, &lt; ,&gt;,= and bitwise AND . some variants offer 2 or even 3 connecting logic conditions.
### Versions
### GPIO MINI V0.001
This firmware supports up to 16 output channels , 16 input channels and 16 analog channels from local sources subject to MCU capability. MCU supported are currently Arduino Pro-Mini , Arduino Uno and Arduino Mega2560. The Output channels can be activated via one condition with logical operations of &lt; , &gt; and = Only onboard(local) io are supported in this version.
### GPIO MINI V0.002
This firmware offers the same features as V0.001 but with the ability to also access the output channel data values from a Speeduino ECU connected directly using the Speeduino Serial3 support.This firmware is currently only supported by Arduino Mega2560
### GPIO MINI V0.003
This firmware allows Speeduino to access the GPIO device's inputs(both digital and analog) to be displayed within TunerStudio or logged.Again in this version the GPIO device is still connected directly to the Speeduino via Serial3.This firmware is currently only supported by Arduino Mega2560
### GPIO MINI V3.001
This firmware has substantial improvements to the speed and stability of the Serial3 link with Speeduino. It also introduced the Display code module, which gives support for two displays of either I2C or SPI type. There are a few dispaly types pre configured and the list is growing. Current support
1. SSD1306 , Hardware I2C
2. SSH1106 , Hardware I2C
3. SSH1106 , Hardware SPI
4. SSH1106 , Hardware SPI
The display section offer users the ability to easily integrate a custom display solution without worrying about timing or the serial protocols itself. All GPIO system realtime variables are available to use withon the display routine.
### GPIO STD V1.000
This firmware offer the first of a range of BCU or "body control unit" features.
Max number of input pins supported is 32 (subject to mcu limitations)
Max number of output pins supported is 32 (subject to mcu limitations)
Max number of analog inputs supported is 16 (subject to mcu limitations)
The firmware supports up to 2 canbus modules via spi(mcp2515) specified as CAN0 and CAN1
CAN0 is used for broadcast and other general use
CAN1 is for OBD2 use. The port offers a wide range of data to any STD code reader. In this firmware only realtime data is available.If the Speeduino ECU is connected to GPIO then all the supported realtime from The Speeduino will be available to the OBD2 reader.
Inputs can be linked to canbus addresses and have their status periodically broadcast at a selectable rate on CAN0.
Outputs can be linked to a Canbus address and have their status changed upon reciept of a valid value on CAN0.They can also broadcast on a selectable can address, at a selectable rate the status of the output including and error or fault detection that the output stage may support.
This Firmware also offers Generic 11bit broadcasting of any outchannel data.
Software installation
---------------------
You can download the latest versions of GPIO here <https://github.com/Autohome2/Speeduino-GPIO>
If you are installing one of the versions with CANBUS you will need to install the libraries to your Arduino IDE if you dont have a current version installed.The libraries are included in the download.
The libraries used are:
Canbus .This is for the mcp2515 can modules if used. This library is included in the libraries folder in the GPIO git download.
U8g2. This is the display library used.This library is included in the libraries folder in the GPIO git download.
Flexcan from Pawelsky( for Teensy onboard Can)[1](https://github.com/pawelsky/FlexCAN_Library)
The flexcan library is included in the installation of Teensyduino into the Arduino IDE[2](https://www.pjrc.com/teensy/td_download.html)
The Tunerstudio INI file and base tune can be found in the reference folder for the specific variant you wish to install in the download . NOTE it is very important to install the correct ini and base msq for the selected firmware. A demo dash fie for tunerstudio may also be provided.
Realtime Data Organisation
--------------------------
Some versions of GPIO support the ability to access the realtime data from the GPIO I/O ports remotely via Either the Serial3 port or Canbus (see model versions). The data is stuctured as an offset address to the GPIO device real canID.
- 1 - 32 The Digital Inputs 1 through 32. These Send a value of 1023 if ON and 0 when OFF.
<!-- -->
- 33 - 64 The Digital Outputs 1 through 32. These have an ON value of 1023 and an Off value of 0.
<!-- -->
- 65 - 81 The Analog Inputs 0 through 15. These Send a value ranging from 0 to 1024.
example:
`if the GPIO real canID == 0x105 (261dec)`
`to request analog 0 you would request data from 261dec + 65dec == 326dec == 0x146`
The data is located in bytes 0 and 1 of the 8 transmitted , 0 being lsb 1 being msb.
Configuration
-------------
NOTE! The following information covers many versions of the GPIO family some Configurations,Features or Options may not be available in certain firmware code versions.
### Device Configuration
Device configuration can be found in the Tunerstudio Tab "Settings" then select "device configuration"
![](Gpio_config_2.jpg "Gpio_config_2.jpg")
- **Device Real CanID** - The HEX 11bit Can address of the GPIO device
- **Board Pin Layout** - The Mcu and board layout the GPIO is using
<img src="Board_pin_layout_2.jpg" title="Board_pin_layout_2.jpg" alt="Board_pin_layout_2.jpg" width="400" />
Select the appropriate mcu and board type for your GPIO unit.The firmware download has several board configurations pre setup in the code. Depending on which MCU you compile the firmware with will depend if that configuration is available to use.
- **Speeduino Connection Type**
- **Not used** - This setting if the GPIO is a standalone device
- **Via Serial3** - This setting if the GPIO connects directly using its serial connection to the secondary serial port on the Speeduino(usually Serial3).
- **Via CanBus** - This setting if the GPIO is connected using its CanBus .This is pre-set at 11bit 250kbps.
<img src="Speeduino_connection_2.jpg" title="Speeduino_connection_2.jpg" alt="Speeduino_connection_2.jpg" width="400" />
- **Speeduino Realtime Base CanBus Address** - The HEX 11bit Can address of the Speeduino ECU
- **GPIO OBD Address** - The HEX 11bit CanBus address of the GPIO OBD port
### Project Properties
In project Properties you can enable the Hardware Testpage and CAN_COMMANDS. Select "File", "Vehicle Projects", "Project Properties".
<img src="Project_properties_select.jpg" title="Project_properties_select.jpg" alt="Project_properties_select.jpg" width="800" />
Yuo can now enable/disable the appropriate options. The project will reload after you confirm the changes.
<img src="Project_properties_gpio.jpg" title="Project_properties_gpio.jpg" alt="Project_properties_gpio.jpg" width="800" />
### Programmable I/O and Output config
From the Programmable Outputs Tab you can select to configure the Universal outputs or the External IO
<img src="Prog_outputs1.jpg" title="Prog_outputs1.jpg" alt="Prog_outputs1.jpg" width="400" />
### Configuring Universal Outputs
This page enables the configuration of the Universal Outputs.
<img src="Universal_outputs1_16.jpg" title="Universal_outputs1_16.jpg" alt="Universal_outputs1_16.jpg" width="500" />
- *' Output port*' - This is the output port on the GPIO device . To use first select a port from the output port list ,configure the setting for that port and then click "burn" to burn the changes to your GPIO device(if online)
<!-- -->
- *' Port settings*'
- - *' Enabled*' - Enables this output port
- *' Power on value*' - The active state of the port when the GPIO device starts up
- *' Active value*' - The active output state(Active High or Active Low)
<!-- -->
- *' Active conditions*'
- - *' Controller*' - This is fixed as the name of the GPIO device in use
- *' Output channel*' - This is either the realtime output data from the local GPIO device or data from External devices[(see external data configuration)]((see_external_data_configuration) "wikilink")).
- *' Logic option*' - The logical operation on the source value compared to the threshold , select &lt;,&gt;, =, or &
- *' Threshold*' - The Trigger threshold for the output vs the source data.
- ''' Hysteresis ''' - The threshold used with the threshold value
- ''' Linking Logical condition ''' This is the logical operation(if applicable/available) between the first and second data source.
- *' Output channel(second data source)*' - This is either the realtime output data from the local GPIO device or data from External devices[(see external data configuration)]((see_external_data_configuration) "wikilink")).
- *' Logic option(second data source)*' - The logical operation on the source value compared to the threshold , select &lt;,&gt;, =, or &
- *' Threshold(second data source)*' - The Trigger threshold for the output vs the source data.
- ''' Hysteresis(second data source) ''' - The threshold used with the threshold value
To use the universal outputs
1. select the appropriate output port, be sure that the port is in use and not used by other functions it may clash operstion with.
2. select "enabled"
3. choose the power on state of the port
4. choose if the port is to be active high or low(on or off)
5. select the output channel the data is to be sourced from
6. select the logic operation the data equation is to use.If you choose "&" then the threshold and hysteresis have slightly different purposes see example in next section.
7. input the threshold value the data formula is to use
8. input the hysteresis value . This value will stop the output switching on/off repeatedly if the data only changes a small amount .
`If logical operation was "&" then the threshold value is the value the data is logically ANDed to. and the result of that is compared to the value input in hysteresis.If the comparison of the ANDed value == the value in hysteresis then the output is active .                       This is useful for bit operations eg the digital inputs.`
Some controller firmware offer support for a second set of input and comparison , with and additional lnking logical operation between the two. This linking operation can be OR , AND and NOT(!).
1. OR , the output is active if EITHER or BOTH statement is true.
2. AND , the output is active only if BOTH statement are true.
3. NOT , the output is active if ONLY ONE of the statement are true.
The second output channel,logic operation ,threshold and hysteresis must be chosen for the second comparison input in a similar manner to the first.
### External IO Configuration
### Configuring external data input sources
This page configures the external input data sources.
<img src="Externalio_config_2.jpg" title="Externalio_config_2.jpg" alt="Externalio_config_2.jpg" width="800" />
- **Input Alias** - This is a user defined Alias name (up to 20 characters) for the input channel.This will appear on the gauge for the channel.
<!-- -->
- **External Input Channel Selection** - Enable/disable the external input channel
<!-- -->
- **Source Base CanID** - The 11bit HEX CanID of the device the data is to be sourced from.
EG: In the picture this is set to 0x200 which was the Speeduino Base Can address set in "device configuration"
- **Data from outchannel** - The outchannel number (from realtime outchannels) the data BEGINS at.
If the device is being accessed via CANBUS then this is the offset added to the base address +1 EG: in the picture it is 7 this would give a Can address of 0x208 or if a direct connection with Speeduino collect data from outchannel 7 (tpsADC)
- **no: of bytes** - The number of bytes the data has , select 1 or 2 (a 1 byte value has a range 0-254 , a 2 byte from 0 - 1024).
EG: In the picture it shows 1. This is due to outchannel 7(tpsADC) being only 1 byte long with a value of 0 - 254.
### Hardware Test Page
To see this option you must enable it in [Project Properties](#project_properties "wikilink")
Then a new Tab will appear on the main dash
<img src="Hardware_test_tab_gpio.jpg" title="Hardware_test_tab_gpio.jpg" alt="Hardware_test_tab_gpio.jpg" width="800" />
- Test Output Hardware
- Test Input Hardware
#### Test Output Hardware
This will allow you to individually turn on/off output ports that are available . The availability depends on the board you have selected and pin configuration.
To start testing click on "Enable test mode" . The output ports that can be tested will then be unGreyed and can be clicked on/off. After testing either click "Stop test mode" or just close the window. Any outputs still activated will be switched off.
<img src="Hardware_output_test.jpg" title="Hardware_output_test.jpg" alt="Hardware_output_test.jpg" width="800" />
#### Test Input Hardware
This will allow you to monitor operation of the digital inputs or force the input ,overriding what GPIO sees.
The availability depends on the board you have selected and pin configuration.
Whilst test mode is NOT enabled you can observe the current state of an input pin on the "STATE" button for the appropriate input.This will be black when active(high) and grey when not(low).When test mode is enabled this feature does not work.
To start overide testing click on "Enable test mode" . The Input ports that can be tested will then be unGreyed and can be clicked on/off. After testing either click "Stop test mode" or just close the window. Any Inputs overriden will be returned to their current true input state.
<img src="Test_input_hardware.jpg" title="Test_input_hardware.jpg" alt="Test_input_hardware.jpg" width="800" />
### Creating new board layouts/pin configurations
New board types can be easily added to GPIO. It requires changes to be made to two files , "Utils.ino" and the Tunerstudio ini file.
#### Utils.ino
In the utils.ino file is the indiivual configurations for each board option EG:
`     #if defined(CORE_AVR)`
`     case 1: // mega2560 demo V0.001`
`     pinOut[1] = 2; //`
`     pinOut[2] = 3; //`
`     pinOut[3] = 4; //`
`     pinOut[4] = 5; //`
`     pinOut[5] = 255; //`
`     pinOut[6] = 255; //`
`     pinOut[7] = 255; //`
`     pinOut[8] = 255; //`
`     pinOut[9] = 255; //`
`     pinOut[10] = 255; //`
`     pinOut[11] = 255; //`
`     pinOut[12] = 255; //`
`     pinOut[13] = 13; //`
`     pinOut[14] = 255; //`
`     pinOut[15] = 255; //`
`     pinOut[16] = 255; //`
`     pinIn[1] = 6;`
`     pinIn[2] = 7;`
`     pinIn[3] = 8;`
`     pinIn[4] = 9;`
`     pinIn[5] = 255;`
`     pinIn[6] = 255;`
`     pinIn[7] = 255;`
`     pinIn[8] = 255;`
`     pinIn[9] = 255;`
`     pinIn[10] = 255;`
`     pinIn[11] = 255;`
`     pinIn[12] = 255;`
`     pinIn[13] = 255;`
`     pinIn[14] = 255;`
`     pinIn[15] = 255;`
`     pinIn[16] = 255;`
`            `
`     pinAin[1] = A0;`
`     pinAin[2] = A1;`
`     pinAin[3] = A2;`
`     pinAin[4] = A3;`
`     pinAin[5] = A4;`
`     pinAin[6] = A5;`
`     pinAin[7] = A6;`
`     pinAin[8] = A7;`
`     pinAin[9] = A8;`
`     pinAin[10] = A9;`
`     pinAin[11] = A10;`
`     pinAin[12] = A11;`
`     pinAin[13] = A12;`
`     pinAin[14] = A13;`
`     pinAin[15] = A14;`
`     pinAin[16] = A15;`
`     `
`     break;`
`     #endif `
This is the entry for position 1 the STD mega2560 board.
To add a new board create a new case with all the above pins. Ensure you change the MCU define if it is not a mega2560 to that of the MCU you are compiling with(only mega2560 is currently supported in). Any pins that are not used must be set to 255. EG: adding a new entry called"mynewboard" in position 6.
`     #if defined(CORE_AVR)`
`     case 6: // mynewboard`
`     pinOut[1] = 2; //`
`     pinOut[2] = 3; //`
`     pinOut[3] = 255; //`
`     pinOut[4] = 5; //`
`     pinOut[5] = 255; //`
`     pinOut[6] = 255; //`
`     pinOut[7] = 255; //`
`     pinOut[8] = 255; //`
`     pinOut[9] = 255; //`
`     pinOut[10] = 4; //`
`     pinOut[11] = 255; //`
`     pinOut[12] = 255; //`
`     pinOut[13] = 13; //`
`     pinOut[14] = 255; //`
`     pinOut[15] = 255; //`
`     pinOut[16] = 255; //`
`     pinIn[1] = 6;`
`     pinIn[2] = 7;`
`     pinIn[3] = 8;`
`     pinIn[4] = 255;`
`     pinIn[5] = 255;`
`     pinIn[6] = 255;`
`     pinIn[7] = 255;`
`     pinIn[8] = 255;`
`     pinIn[9] = 255;`
`     pinIn[10] = 9;`
`     pinIn[11] = 255;`
`     pinIn[12] = 255;`
`     pinIn[13] = 255;`
`     pinIn[14] = 255;`
`     pinIn[15] = 255;`
`     pinIn[16] = 255;`
`            `
`     pinAin[1] = A0;`
`     pinAin[2] = A1;`
`     pinAin[3] = A2;`
`     pinAin[4] = A11;`
`     pinAin[5] = A4;`
`     pinAin[6] = A7;`
`     pinAin[7] = A6;`
`     pinAin[8] = 255;`
`     pinAin[9] = A8;`
`     pinAin[10] = 255;`
`     pinAin[11] = A10;`
`     pinAin[12] = 255;`
`     pinAin[13] = 255;`
`     pinAin[14] = 255;`
`     pinAin[15] = A14;`
`     pinAin[16] = A15;`
`     `
`     break;`
`     #endif `
`Add that in in the appropriate space ie between 5 and 7 (in they exist or at the end of the options if not).`
Saving and rcomplie the file and upload to your GPIO. Ensure the position used matches that in the ini file mods see next.
#### The Tunerstudio ini
This is located in the "reference" folder in the firmware download. Do not use MS notepad to edit this file!! A good editor is Notepad++ a few software download. The line rquiring editing is line 140
`#define PIN_LAYOUT = "ProMini GPIO v0.002", "Mega2560 GPIO v0.003", "STM32 BluePill GPIO V0.003", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"  `
To add a new entry simply remove one of the "INVALID" and replace with your board name EG: the changed file adding a new board called "mynewboard"
`#define PIN_LAYOUT = "ProMini GPIO v0.002", "Mega2560 GPIO v0.003", "STM32 BluePill GPIO V0.003", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "mynewboard", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" `
This shows the new entry being a position 6(promini is position 0). The board config must be at position 6 in the utils.ino too. When you save the changed file and reload it into Tunerstudio your new board will appear as an option.
### Display Configuration
GPIO(firmware versions may vary level of support) supports up to Two independant screens. They can be connected via I2C or SPI.Each display can be of either type.The display support is configured before uploading the firmware via settings in the display.h file. In the display.h file you will see the following(typical extract from file , may vary)
#### Step1 activate the display and its type
if a display is not in use then comment out the line DISP1_ACTIVE for display 1 or DISP2_ACTIVE for display 2 If display1 is I2C set DISP1_ROUTE to 0 if it is connected to the hardware I2C port or enter the mux address if a TCA9548A I2C mux is in use. The same applies to display2 Uncomment the appropriate USE option according to your display model
//display module options . only choose one of the following defines for display selection , comment out the unused ones //set display 1 type
1. define DISP1_ACTIVE 1 // 1 if in use or comment out
2. define DISP1_ROUTE 0 // direct i2c == 0 , remote == mux address
3. define DISP1_USE_SSD1106_I2C
//\#define DISP1_USE_SSD1306_I2C //\#define DISP1_USE_SSD1106_SPI //\#define DISP1_USE_SSH1106_SPI
//set display 2 type //\#define DISP2_ACTIVE 1
1. define DISP2_ROUTE 0 // direct i2c == 0 , remote == mux address
2. define DISP2_USE_SSD1106_I2C
//\#define DISP2_USE_SSD1306_I2C //\#define DISP2_USE_SSD1106_SPI //\#define DISP2_USE_SSH1106_SPI
#### Step 2 , set display size
This feature is not currently in use as only displays of 128x64 are supported
//set display size
1. define USE_128x64
//\#define USE_128x128
#### Step 3, set the port used by the display
Set The correct pins for your display(1 and/or 2) depending on where they are connected to. DO NOT USE PINS FOR THE DISPLAY THAT ARE CONFIGURED AS PORTS IN UTILS.ino FOR IO PURPOSES!
SPI NOTES: hardware spi on mega2560 mosi == 51, clk(sck) == 52 I2C NOTES: hardware i2c on the mega2560 sda == 20, scl == 21
//set pins for screens in spi mode //display 1
1. define DISPLAY1_CS 7 //pin to use for CS
2. define DISPLAY1_DC 6 //pin to use for DC
3. define DISPLAY1_RESET 8
//display 2
1. define DISPLAY2_CS 7 //pin to use for CS
2. define DISPLAY2_DC 6 //pin to use for DC
3. define DISPLAY2_RESET 8
#### Step 4 , add your display code
now in display.ino add your display code in the "driveDisplay()" function For display1 add the cide after the \#if defined DISP1_ACTIVE For display2 add the cide after the \#if defined DISP2_ACTIVE
HINT!: keep your display code as short as possible to prevent timing hangups, and DO NOT use delay or other blocking functions!
### Canbus Configuration
<img src="Canbus_broadcast_config.jpg" title="fig:Canbus_broadcast_config.jpg" alt="Canbus_broadcast_config.jpg" width="800" /> The CanBus Configuration menu tab options are only visible when CAN_COMMANDS are enabled in [Project Properties](#project_properties "wikilink").
#### CanBus Module Configuration
<img src="Canbus_broadcast_config_B.jpg" title="fig:Canbus_broadcast_config_B.jpg" alt="Canbus_broadcast_config_B.jpg" width="800" /> Here you enable the CAN0 and CAN1 Canbus modules. These modules are MCP2515 SPI modules connected to the hardware spi ports on the mcu.
#### Generic 11bit CanBus Broadcast
The 11bit CanBus Broadast feature offers the ability to periodically broadcast on a specified can address the values from any Outchannel on GPIO. This could include external data read from Speeduino for instance using the [Configuring external data sources](#Configuring_external_data_sources "wikilink") method. <img src="Canbus_broadcast_config_C.jpg" title="fig:Canbus_broadcast_config_C.jpg" alt="Canbus_broadcast_config_C.jpg" width="800" />
- **Name Alias** - This is a user defined Alias name (up to 20 characters) for the broadcast channel .
<!-- -->
- **CAN broadcast channel on/off** - Enable/disable the broadcast channel
<!-- -->
- **Source OutChannel** - The OutChannel data source on GPIO.
<!-- -->
- **Can Broadcast Adddress** - The 11bit HEX Can Address the OutChannel data will be broadcast as being assigned to.
<!-- -->
- **Broadcast Freq** - This is the Frequency the OutChannel data is broadcast at.
### Remote CanBus Triggers
The Remote Trigger menu tab options are only visible when CAN_COMMANDS are enabled in [Project Properties](#project_properties "wikilink").
Remote CanBus triggers come in four varietys , Digtial Input, Analog Input, Digital Output, PWM Output.
They are part of the BCU or BODY CONTROL UNIT functions introduced in the GPIO STD firmwares.
The Remote inputs attach a input port on GPIO to a canbus address. The current status of the input pin is broadcast on the assigned canbus address at the frequency chosen.
The Remote Outputs attach an output port on GPIO to a canbus address. The current status of the output port can be changed by sending a valid value to GPIO on that canbus address.
<img src="Digital_remote_canbus_output_config.jpg" title="Digital_remote_canbus_output_config.jpg" alt="Digital_remote_canbus_output_config.jpg" width="800" />
#### Digital Remote Input Triggers
<img src="remote_digital_input.jpg" title="remote_digital_input.jpg" alt="remote_digital_input.jpg" width="800" />
There are two pages of these configs , channels 0 -15 and 16-31. They have both the same appearance and functions so we will just refer to 0-15 page here.
- **Name Alias** - This is a user defined Alias name (up to 20 characters) for the Remote Input Trigger .
<!-- -->
- **External In** - Enable/disable the remote input channel
<!-- -->
- **Can Address** - The 11bit HEX Can Address the remote Input is linked to.
<!-- -->
- **Input Port** - This is the physical Input port on GPIO the channel is linked to.
<!-- -->
- **Broadcast Freq** - This is the Frequency the status of the input pin port is broadcast at.
<!-- -->
- **Available Input Ports** - This is a list of all Input ports on GPIO. If the port is active(enabled and assigned a pin in utils.ino) then it will be black , else it will be grey.
It is important to NEVER choose a greyed out port as an Input Port selection!
##### Use of Remote Digital input port
To use this feature
1. Enable the channel you wish to configure
2. (optional) set a "alias" name to make remembering the data source easier.
3. choose the Can Address you wish the data to use.
4. select the input port you wish to broadcast the value of.
5. select the frequency the broadcast will be made at , 4,5,10,15, and 20Hz
The broadcast will be made to the specified address at the frequency set with bit0 of Byte 0 (of the 8 can bytes) reflecting the port state.
#### Digital Remote Output Triggers
<img src="Remote_out_triggers.jpg" title="Remote_out_triggers.jpg" alt="Remote_out_triggers.jpg" width="800" />
There are two pages of these configs , channels 0 -15 and 16-31. They have both the same appearance and functions so we will just refer to 0-15 page here.
- **Name Alias** - This is a user defined Alias name (up to 20 characters) for the Remote Output Trigger .
<!-- -->
- **External Out** - Enable/disable the remote output channel
<!-- -->
- **Can Address** - The 11bit HEX Can Address the remote output is linked to.
<!-- -->
- **Output Port** - This is the physical output port on GPIO the channel is linked to.
<!-- -->
- **Send Status?** - Enable/Disable the output status broadcast.
<!-- -->
- **Status Can Address** - The 11bit HEX Can Address the remote output status is broadcasted on.If this option is not available then the data is broadcast on the same can address.
<!-- -->
- **Status Broadcast Frequency** - choose the frequency that the status data is broadcast 4, 5, 10 ,15 and 20Hz.
<!-- -->
- **Available Output Ports** - This is a list of all output ports on GPIO. If the port is active(enabled and assigned a pin in utils.ino) then it will be black , else it will be grey.
It is important to NEVER choose a greyed out port as an Output Port selection!
##### Use of remote outputs
To trigger an output GPIO must receive the following
1. Can Address matching as configured.
2. In byte 0 (of the 8 can bytes) the on/off bit set or reset(bit 0).
##### Status broadcast
If the status broadcast option is chosen then the following information is periodically broadcast(according to the frequency setting)
` Function                          Bit`
`REMOTE_OUT_OFF                      0`
`REMOTE_OUT_ON                       1`
`REMOTE_OUT_OPENCIRCUIT              2`
`REMOTE_OUT_SHORTCIRCUIT             3`
`REMOTE_OUT_THERMALOVERLOAD          4`
`REMOTE_OUT_CURRENTOVERLOAD          5`
`REMOTE_OUT_unused6                  6`
`REMOTE_OUT_unused7                  7`
These bit values are sent in byte 1 (of the 8 can bytes).
#### Analog Remote Input Triggers
<img src="Remote_analog_input.jpg" title="Remote_analog_input.jpg" alt="Remote_analog_input.jpg" width="800" />
- **Name Alias** - This is a user defined Alias name (up to 20 characters) for the Remote Analog Input .
<!-- -->
- **Enable Ain** - Enable/disable the remote analog input channel
<!-- -->
- **Can Address** - The 11bit HEX Can Address the remote analog Input is linked to.
<!-- -->
- **Input Port** - This is the physical analog Input port on GPIO the channel is linked to.
<!-- -->
- **Broadcast Freq** - This is the Frequency the status of the analog input pin port is broadcast at.
<!-- -->
- **Available Analog Input Ports** - This is a list of all Analog Input ports on GPIO. If the port is active(enabled and assigned a pin in utils.ino) then it will be black , else it will be grey.
It is important to NEVER choose a "greyed out" port as an Analog Input Port selection!
##### Use of Remote Analog input port
To use this feature
1. Enable the channel you wish to configure
2. (optional) set a "alias" name to make remembering the data source easier.
3. choose the Can Address you wish the data to use.
4. select the Analog input port you wish to broadcast the value of.
5. select the frequency the broadcast will be made at , 4,5,10,15, and 20Hz
The broadcast will be made to the specified address at the frequency set with the lsb to Byte 0 and the msb to byte 1 (of the 8 can bytes) reflecting the port state(0-1024).
#### PWM Remote Output Triggers
under development!

44
DxControl-Gears.md Normal file
View File

@ -0,0 +1,44 @@
dxControl-Gears , A Gearbox Controller for Speeduino
====================================================
By Darren Siepka
### What is it ?
dxControl-Gears is a controller for electronically controlled Automatic gearboxes , designed to accompany Speeduino. It is a custom development of the dxControl-GPIO code .
It supports up to 32 output channels to drive solenoids and valve , 16 digital input channels ,8 analog input channels.
Future releases will have pwm input and output capability along with direct or Canbus connectivity to the Speeduino ECU.
### Gearbox Configurations Available
1. A340E
2. AODE (coming soon)
3. 5R55s (coming soon)
4. TBA... Yours?
#### The A340E
The A340E made by Aisin Warner can be found in numerous vehicles including mitsubishi and Lexus.
It has Two shift solenoids and electric convertor lockup.
The solenoid to gearselection pattern is
`               Solenoid 1       Solenoid 2`
` Gear 1             on               off`
` Gear 2             on               on`
` Gear 3             off              on`
` Gear 4             off              off`
#### The AODE
#### The 5R55s
### Input Hardware Testing
### Output Hardware Testing

32
Firmware_History.md Normal file
View File

@ -0,0 +1,32 @@
Overview
========
Recent firmware releases can be found below. These may be useful for rolling back if required or if you cannot locate the ini file associated with the firmware you are running.
| Month | Firmware Download | Details |
|---------|----------------------------------------------------------------|-----------------------------------------------------------------|
| 02/2019 | <https://github.com/noisymime/speeduino/archive/201902.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=2599> |
| 10/2018 | <https://speeduino.com/wiki/images/d/d7/Speeduino-Oct18.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=2456> |
| 8/2018 | <https://speeduino.com/wiki/images/d/da/Speeduino-Aug18-2.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=2062> |
| 6/2018 | <https://speeduino.com/wiki/images/e/e0/Speeduino-Jun18.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1938> |
| 5/2018 | <https://speeduino.com/wiki/images/0/0d/Speeduino-May18.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1885&p=26339> |
| 4/2018 | <https://speeduino.com/wiki/images/3/30/Speeduino-Apr18.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1828&p=25950> |
| 2/2018 | <https://speeduino.com/wiki/images/7/78/Speeduino-Feb18.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1706> |
| 12/2017 | <https://speeduino.com/wiki/images/3/30/Speeduino-Dec17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1593> |
| 11/2017 | <https://speeduino.com/wiki/images/2/24/Speeduino-Nov17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1560&p=22975> |
| 10/2017 | <https://speeduino.com/wiki/images/5/53/Speeduino-Sep17b.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1434> |
| 9/2017 | <https://speeduino.com/wiki/images/1/19/Speeduino-Sep17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1434> |
| 8/2017 | <https://speeduino.com/wiki/images/c/ca/Speeduino-Aug17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1387> |
| 7/2017 | <https://speeduino.com/wiki/images/4/49/Speeduino_Jul17b.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1325> |
| 6/2017 | <https://speeduino.com/wiki/images/c/c3/Speeduino_Jun17b.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1278> |
| 5/2017 | <https://speeduino.com/wiki/images/f/fa/Speeduino_May17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1223> |
| 4/2017 | <https://speeduino.com/wiki/images/b/bf/Speeduino_Apr17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1184> |
| 3/2017 | <http://speeduino.com/wiki/images/2/24/Speeduino_Mar17.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1129> |
| 2/2017 | <http://speeduino.com/wiki/images/4/4c/Speeduino_Feb17b.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1082> |
| 1/2017 | <http://speeduino.com/wiki/images/2/20/Speeduino_Jan17b.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=1035> |
| 12/2016 | <http://speeduino.com/wiki/images/3/32/Speeduino_Dec16.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=978> |
| 11/2016 | <http://speeduino.com/wiki/images/3/38/Speeduino_Nov16.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=916> |
| 10/2016 | <http://speeduino.com/wiki/images/8/87/Speeduino_Oct16.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=875> |
| 9/2016 | <http://speeduino.com/wiki/images/a/a1/Speeduino_Sep16b.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=820> |
| 8/2016 | <http://speeduino.com/wiki/images/a/a1/Speeduino_Aug16.zip> | <https://speeduino.com/forum/viewtopic.php?f=13&t=763> |

299
GPIO_for_Speeduino.md Normal file
View File

@ -0,0 +1,299 @@
GPIO for Speeduino
==================
By Darren Siepka
### What is it?
GPIO for Speeduino are a family of multipurpose general programmable input and output modules that can be used both in conjunction with the Speeduino engine ECU or standalone. The modules are programmed via Tunerstudio either via the serial port or over the integrated CanBus network(certain variants only)
The modules can use several different processor board types, including different arduino, teensy and stm32.
Io operations are programmed with logic, &lt; ,&gt;,= and bitwise AND . some variants offer 2 or even 3 connecting logic conditions.
### Versions
### GPIO MINI V0.001
This firmware supports up to 16 output channels , 16 input channels and 16 analog channels from local sources subject to MCU capability. MCU supported are currently Arduino Pro-Mini , Arduino Uno and Arduino Mega2560. The Output channels can be activated via one condition with logical operations of &lt; , &gt; and = Only onboard(local) io are supported in this version.
### GPIO MINI V0.002
This firmware offers the same features as V0.001 but with the ability to also access the output channel data values from a Speeduino ECU connected directly using the Speeduino Serial3 support.This firmware is currently only supported by Arduino Mega2560
### GPIO MINI V0.003
This firmware allows Speeduino to access the GPIO device's inputs(both digital and analog) to be displayed within TunerStudio or logged.Again in this version the GPIO device is still connected directly to the Speeduino via Serial3.This firmware is currently only supported by Arduino Mega2560
Software installation
---------------------
You can download the latest versions of GPIO here <https://github.com/Autohome2/Speeduino-GPIO>
If you are installing one of the versions with CANBUS you will need to install the libraries to your Arduino IDE if you dont have a current version installed.The libraries are included in the download.
The libraries used are:
Canbus from CoryJFowler (for spi canbus modules)[1](https://github.com/coryjfowler/MCP_CAN_lib)
Flexcan from Pawelsky( for Teensy onboard Can)[2](https://github.com/pawelsky/FlexCAN_Library)
The flexcan library is included in the installation of Teensyduino into the Arduino IDE[3](https://www.pjrc.com/teensy/td_download.html)
The Tunerstudio INI file and base tune can be found in the reference folder for the specific variant you wish to install in the download . NOTE it is very important to install the correct ini and base msq for the selected firmware.
Realtime Data Organisation
--------------------------
Some versions of GPIO support the ability to access the realtime data from the GPIO I/O ports remotely via Either the Serial3 port or Canbus (see model versions). The data is stuctured as an offset address to the GPIO device real canID.
1 - 32
The digital inputs 1 through 32. These send a value of 1023 if ON and 0 when OFF.
33 - 64
The Digital Outputs 1 through 32. These have an ON value of 1023 and an Off value of 0.
65 - 81
The analog inputs 0 through 15. These Send a value ranging from 0 to 1024.
example: if the GPIO real canID == 0x105 to request analog 0 you would request data from 261dec + 65dec == 326dec == 0x146
The data is located in bytes 0 and 1 of the 8 transmitted , 0 being lsb 1 being msb.
Configuration
-------------
### Device Configuration
Device configuration can be found in the Tunerstudio Tab "Settings" then select "device configuration"
![](Gpio_config.jpg "Gpio_config.jpg")
- **Device Real CanID** - The HEX 11bit Can address of the GPIO device
- **Board Pin Layout** - The Mcu and board layout the GPIO is using
<img src="Board_pin_layout.jpg" title="Board_pin_layout.jpg" alt="Board_pin_layout.jpg" width="400" />
Select the appropriate mcu and board type for your GPIO unit.The firmware download has several board configurations pre setup in the code. Depending on which MCU you compile the firmware with will depend if that configuration is available to use.
- **Speeduino Connection Type**
- **Not used** - This setting if the GPIO is a standalone device
- **Via Serial3** - This setting if the GPIO connects directly using its serial connection to the secondary serial port on the Speeduino(usually Serial3).
- **Via CanBus** - This setting if the GPIO is connected using its CanBus .This is pre-set at 11bit 250kbps.
<img src="Speeduino_connection.jpg" title="Speeduino_connection.jpg" alt="Speeduino_connection.jpg" width="400" />
- **Speeduino Base CanBus Address** - The HEX 11bit Can address of the Speeduino ECU
### Programmable I/O and Output config
From the Programmable Outputs Tab you can select to configure the Universal outputs or the External IO
<img src="Prog_outputs1.jpg" title="Prog_outputs1.jpg" alt="Prog_outputs1.jpg" width="400" />
### Configuring Outputs
This page enables the configuration of the Universal Outputs.
<img src="Universal_outputs.jpg" title="Universal_outputs.jpg" alt="Universal_outputs.jpg" width="500" />
- *' Output port*' - This is the output port on the GPIO device . To use first select a port from the output port list ,configure the setting for that port and then click "burn" to burn the changes to your GPIO device(if online)
<!-- -->
- *' Port settings*'
- - *' Enabled*' - Enables this output port
- *' Power on value*' - The active state of the port when the GPIO device starts up
- *' Active value*' - The active output state(Active High or Active Low)
<!-- -->
- *' Active conditions*'
- - *' Controller*' - This is fixed as the name of the GPIO device in use
- *' Output channel*' - This is either the realtime output data from the local GPIO device or data from External devices[(see external data configuration)]((see_external_data_configuration) "wikilink")).
- *' Logic option*' - The logical operation on the source value compared to the threshold , select &lt;,&gt;, or =
- *' Threshold*' - The Trigger threshold for the output vs the source data.
- ''' Hysteresis ''' - The threshold used with the threshold value
### Configuring external data sources
This page enable the configuration of the external data sources.
<img src="Externalio_config.jpg" title="Externalio_config.jpg" alt="Externalio_config.jpg" width="800" />
- **External Input Channel Selection** - Enable/disable the external input channel
<!-- -->
- **Source Base CanID** - The 11bit HEX CanID of the device the data is to be sourced from.
EG: In the picture this is set to 0x200 which was the Speeduino Base Can address set in "device configuration"
- **Data from outchannel** - The outchannel number (from realtime outchannels) the data BEGINS at.
If the device is being accessed via CANBUS then this is the offset added to the base address +1 EG: in the picture it is 7 this would give a Can address of 0x208 or if a direct connection with Speeduino collect data from outchannel 7 (tpsADC)
- **no: of bytes** - The number of bytes the data has , select 1 or 2 (a 1 byte value has a range 0-254 , a 2 byte from 0 - 1024).
EG: In the picture it shows 1. This is due to outchannel 7(tpsADC) being only 1 byte long with a value of 0 - 254.
### Hardware Test Page
To see this option you must enable it in project properties
<img src="Project_properties_select.jpg" title="Project_properties_select.jpg" alt="Project_properties_select.jpg" width="800" />
<img src="Project_properties_gpio.jpg" title="Project_properties_gpio.jpg" alt="Project_properties_gpio.jpg" width="800" />
Then a new Tab will appear on the main dash
<img src="Hardware_test_tab_gpio.jpg" title="Hardware_test_tab_gpio.jpg" alt="Hardware_test_tab_gpio.jpg" width="800" />
#### Test Output Hardware
This will allow you to individually turn on/off output ports that are available . The availability depends on the board you have selected and pin configuration.To start testing click on "Enable test mode" . The output ports that can be tested will then be unGreyed and can be clicked on/off. After testing either click "Stop test mode" or just close the window. Any outputs still activated will be switched off.
<img src="Hardware_output_test.jpg" title="Hardware_output_test.jpg" alt="Hardware_output_test.jpg" width="800" />
### Creating new board layouts/pin configurations
New board types can be easily added to GPIO. It requires changes to be made to two files , "Utils.ino" and the Tunerstudio ini file.
#### Utils.ino
In the utils.ino file is the indiivual configurations for each board option EG:
`     #if defined(CORE_AVR)`
`     case 1: // mega2560 demo V0.001`
`     pinOut[1] = 2; //`
`     pinOut[2] = 3; //`
`     pinOut[3] = 4; //`
`     pinOut[4] = 5; //`
`     pinOut[5] = 255; //`
`     pinOut[6] = 255; //`
`     pinOut[7] = 255; //`
`     pinOut[8] = 255; //`
`     pinOut[9] = 255; //`
`     pinOut[10] = 255; //`
`     pinOut[11] = 255; //`
`     pinOut[12] = 255; //`
`     pinOut[13] = 13; //`
`     pinOut[14] = 255; //`
`     pinOut[15] = 255; //`
`     pinOut[16] = 255; //`
`     pinIn[1] = 6;`
`     pinIn[2] = 7;`
`     pinIn[3] = 8;`
`     pinIn[4] = 9;`
`     pinIn[5] = 255;`
`     pinIn[6] = 255;`
`     pinIn[7] = 255;`
`     pinIn[8] = 255;`
`     pinIn[9] = 255;`
`     pinIn[10] = 255;`
`     pinIn[11] = 255;`
`     pinIn[12] = 255;`
`     pinIn[13] = 255;`
`     pinIn[14] = 255;`
`     pinIn[15] = 255;`
`     pinIn[16] = 255;`
`            `
`     pinAin[1] = A0;`
`     pinAin[2] = A1;`
`     pinAin[3] = A2;`
`     pinAin[4] = A3;`
`     pinAin[5] = A4;`
`     pinAin[6] = A5;`
`     pinAin[7] = A6;`
`     pinAin[8] = A7;`
`     pinAin[9] = A8;`
`     pinAin[10] = A9;`
`     pinAin[11] = A10;`
`     pinAin[12] = A11;`
`     pinAin[13] = A12;`
`     pinAin[14] = A13;`
`     pinAin[15] = A14;`
`     pinAin[16] = A15;`
`     `
`     break;`
`     #endif `
This is the entry for position 1 the STD mega2560 board.
To add a new board create a new case with all the above pins. Ensure you change the MCU define if it is not a mega2560 to that of the MCU you are compiling with(only mega2560 is currently supported in). Any pins that are not used must be set to 255. EG: adding a new entry called"mynewboard" in position 6.
`     #if defined(CORE_AVR)`
`     case 6: // mynewboard`
`     pinOut[1] = 2; //`
`     pinOut[2] = 3; //`
`     pinOut[3] = 255; //`
`     pinOut[4] = 5; //`
`     pinOut[5] = 255; //`
`     pinOut[6] = 255; //`
`     pinOut[7] = 255; //`
`     pinOut[8] = 255; //`
`     pinOut[9] = 255; //`
`     pinOut[10] = 4; //`
`     pinOut[11] = 255; //`
`     pinOut[12] = 255; //`
`     pinOut[13] = 13; //`
`     pinOut[14] = 255; //`
`     pinOut[15] = 255; //`
`     pinOut[16] = 255; //`
`     pinIn[1] = 6;`
`     pinIn[2] = 7;`
`     pinIn[3] = 8;`
`     pinIn[4] = 255;`
`     pinIn[5] = 255;`
`     pinIn[6] = 255;`
`     pinIn[7] = 255;`
`     pinIn[8] = 255;`
`     pinIn[9] = 255;`
`     pinIn[10] = 9;`
`     pinIn[11] = 255;`
`     pinIn[12] = 255;`
`     pinIn[13] = 255;`
`     pinIn[14] = 255;`
`     pinIn[15] = 255;`
`     pinIn[16] = 255;`
`            `
`     pinAin[1] = A0;`
`     pinAin[2] = A1;`
`     pinAin[3] = A2;`
`     pinAin[4] = A11;`
`     pinAin[5] = A4;`
`     pinAin[6] = A7;`
`     pinAin[7] = A6;`
`     pinAin[8] = 255;`
`     pinAin[9] = A8;`
`     pinAin[10] = 255;`
`     pinAin[11] = A10;`
`     pinAin[12] = 255;`
`     pinAin[13] = 255;`
`     pinAin[14] = 255;`
`     pinAin[15] = A14;`
`     pinAin[16] = A15;`
`     `
`     break;`
`     #endif `
`Add that in in the appropriate space ie between 5 and 7 (in they exist or at the end of the options if not).`
Saving and rcomplie the file and upload to your GPIO. Ensure the position used matches that in the ini file mods see next.
#### The Tunerstudio ini
This is located in the "reference" folder in the firmware download. Do not use MS notepad to edit this file!! A good editor is Notepad++ a few software download. The line rquiring editing is line 140
`#define PIN_LAYOUT = "ProMini GPIO v0.002", "Mega2560 GPIO v0.003", "STM32 BluePill GPIO V0.003", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"  `
To add a new entry simply remove one of the "INVALID" and replace with your board name EG: the changed file adding a new board called "mynewboard"
`#define PIN_LAYOUT = "ProMini GPIO v0.002", "Mega2560 GPIO v0.003", "STM32 BluePill GPIO V0.003", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "mynewboard", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" `
This shows the new entry being a position 6(promini is position 0). The board config must be at position 6 in the utils.ino too. When you save the changed file and reload it into Tunerstudio your new board will appear as an option.

View File

@ -0,0 +1,44 @@
Dxcontrol-Gears , A Gearbox Controller for Speeduino
====================================================
By Darren Siepka
### What is it ?
dxControl-Gears is a controller for electronically controlled Automatic gearboxes , designed to accompany Speeduino. It is a custom development of the dxControl-GPIO code .
It supports up to 32 output channels to drive solenoids and valve , 16 digital input channels ,8 analog input channels.
Future releases will have pwm input and output capability along with direct or Canbus connectivity to the Speeduino ECU.
### Gearbox Configurations Available
1. A340E
2. AODE (coming soon)
3. 5R55s (coming soon)
4. TBA... Yours?
#### The A340E
The A340E made by Aisin Warner can be found in numerous vehicles including mitsubishi and Lexus.
It has Two shift solenoids and electric convertor lockup.
The solenoid to gearselection pattern is
`               Solenoid 1       Solenoid 2`
` Gear 1             on               off`
` Gear 2             on               on`
` Gear 3             off              on`
` Gear 4             off              off`
#### The AODE
#### The 5R55s
### Input Hardware Testing
### Output Hardware Testing

14
Getting_Started.md Normal file
View File

@ -0,0 +1,14 @@
<languages/> <translate>
- Wiring and hardware setup
- [Hardware requirements](Special:MyLanguage/Hardware_requirements "wikilink") - What hardware you will need to have in order to work with Speeduino (Sensors, wiring, injectors, coils etc)
- Specific board information
- [v0.3 board](Special:MyLanguage/v0.3 "wikilink")
- [v0.4 board](Special:MyLanguage/v0.4 "wikilink")
- [Compiling and Installing Firmware](Special:MyLanguage/Compiling_and_Installing_Firmware "wikilink")
- Working with Tuner Studio
- [Connecting to TunerStudio](Special:MyLanguage/Connecting_to_TunerStudio "wikilink")
- [Bluetooth connections](Bluetooth "wikilink")
- [Configuring TunerStudio](Special:MyLanguage/Configuring_TunerStudio "wikilink")
</translate>

209
Hardware_requirements.md Normal file
View File

@ -0,0 +1,209 @@
Arduino
-------
Speeduino uses the Arduino Mega 2560 R3 as the controller. All official and most clone Arduino Mega 2560 boards will work fine, but it is recommended to use a board that has the 16u2 serial interface rather than the cheaper CH340. Which chip a board uses can usually be found on the information/specification listing from most retailers, but if in doubt, ask the seller you are looking to buy from.
Inputs
------
### Crank sensor
This is arguably the most important sensor for Speeduino to function correctly. The signal going to the Arduino must be a 0v-5v square wave series of pulses (shown below) representing teeth on a wheel running at crank (or cam) speed. Many Hall and 'opto' sensors meet this digital square-wave spec. If only a crankshaft trigger wheel is used (no cam signal), the crank wheel must have a 'missing' tooth in order to provide position information as well as the engine RPM. Tested missing-tooth wheels currently are 4-1, 12-1, 36-1 and 60-2.
Alternatively (and necessary for full-sequential injection) an added cam signal with or without crank wheel missing teeth. These setups are indicated by the added "/x", such as 60-2/1, for a 60-tooth crank wheel, with 2 missing teeth, and a 1-tooth cam signal per cycle. Cam-speed missing-tooth wheels can also support semi and full-sequential.
VR (variable reluctance) sensors can also be used, however as the board does not contain any sort of signal conditioner to convert the sine wave (below) to the required square wave, an additional module will be needed. An 8-pin DIP socket is located on v0.3.x and v0.4.x series official boards for this purpose as IC3. The MAX9926 chip has been tested to work with most types of input signals, and is available from the [Speeduino Store](https://speeduino.com/shop/index.php?id_product=17&controller=product), however any similar module that outputs a 0v-5v square wave (LM1815, LM358, SSC/DSC, many OEM modules, etc.) should also work fine with VR sensor signals.
![](Sine-square_waves.jpg "Sine-square_waves.jpg")
### TPS
TPS sensor must be of the 3 wire potentiometer type, rather than the 2 wire on/off switches found on some throttles. If your TPS is a 3 wire sensor then it will likely work, however you will need to confirm it is a potentiometer (variable) type sensor.
The TPS functions by sending an analog variable voltage signal to Speeduino in order to report the current position of the throttle. It is typically supplied with V+ of 5V and ground (GND, signal ground, or signal return), routing through an internal potentiometer to output a low voltage at low throttle opening, and a rising voltage with greater throttle opening.
If using a TPS with unknown connections; it is recommended to test the TPS with an ohm meter in order to determine the connection of each pin without risking damage by applying sensor power randomly. This can be accomplished on the bench or with the engine off and TPS disconnected:
- Assign a letter to each pin.
- Attach the ohm meter to two pins, and operate the throttle from closed (idle) to wide-open (WOT), recording the results.
- Find the pair of pins where the resistance does not change significantly from idle to WOT. These are your two power pins.
- The remaining pin is your **Signal** pin.
- In order to determine which power pin is **V+** and which is **GND**, test ohms between the **Signal** pin and one power pin.
- In idle position; if ohms are low that power pin is **GND**. If ohms are high that power pin is **V+**.
Most usable TPS sensors have 3 pins. If your TPS has a different number of pins, referring to the original engine wiring diagram may show the function, and whether it is usable or which pins to use for Speeduino. For TP sensors that work 'backwards', and wiring cannot be changed, a simple code modification is available on the [Forums](https://speeduino.com/forum/viewtopic.php?f=19&t=1159#p18146) to make use of this type of TPS.
### MAP (Manifold Pressure)
Recommended MAP sensor is the MPX4250 from Freescale, however many MAP sensors are supported. If you want to use one that is not included in the list (Under Tools-&gt;Map Calibration in TunerStudio) then please make a new thread in the forum requesting this. Other sensors can and will work just fine, but you will need to calibrate these within TunerStudio against a different set of values.
### Temperature Sensors (CLT and IAT)
Any standard 2-wire thermistor sensor can be used for these temperature functions. The sensors have 1 side connected to a ground (Preferably from the ECU) and the other running to the signal line. These sensors have no polarity, so the orientation of these wires does not matter.
For full details, please see the [Sensor Calibration](Sensor_Calibration "wikilink") page
### Exhaust Gas Oxygen Sensors (O2 and WBO2)
The type of O2 sensor (narrow or wide-band) must be selected in TunerStudio under *Tools &gt; Calibrate AFR Table*.
#### Narrow-band
NBO2 sensor signals are read directly by Speeduino. TunerStudio applies the standard non-linear 0-volt to 1-volt values for all standard NBO2 sensors automatically under calibration. Once set in calibration, Speeduino will use the designated NBO2 to adjust fueling according to the entries you make in the AFR table (*Tuning &gt; AFR Table*), and the sensor is selected for type and parameters (or disabled) under *Tuning &gt; AFR/O2*. Note that narrow-band sensors were originally designed to target stoichiometric AFR (Lambda 1.0) for efficient catalytic emissions control, and are generally not sufficiently accurate or suitable for tuning efficient lean economy or rich power fueling. While not recommended; involved tuning methods are available to allow limited and approximate tuning for lean and rich AFRs using a NBO2 sensor.
#### Wide-band
Wide-band oxygen (WBO2) sensors can detect and report a wider range of lambda (ƛ) or AFRs than narrow-band, and with greater accuracy, from approximately 10:1 to 20:1 (about 0.7 to 1.3 lambda), depending on specific sensor version and controller. Speeduino cannot use WBO2 sensors directly, requiring an external controller to process the signal and to apply sensor heating control. Enter the controller brand and model from the list displayed. If the controller signal is generic linear or custom, select and enter the required information, or an option to install a custom INC file is available in the menu list.
Once set in *Tools &gt; Calibrate AFR Sensor*, Speeduino can use the designated WBO2 to report lambda/AFR to TunerStudio for gauge display. After the sensor is selected for type and parameters under *Tuning &gt; AFR/O2* it can adjust corrective fueling on-the-fly according to the entries you make in the AFR table (*Tuning &gt; AFR Table*), and for auto-tuning in TunerStudio, or MegaLogViewer in real-time or from logs. Settings also include the option to disable. Although Speeduino can use the WBO2 information to correct fueling; it is strongly suggested it not be used to compensate for poor tuning.
### Application-Specific Inputs
Circuits and techniques Speeduino users have found useful for adapting or implementing certain inputs or functions.
#### Flex Fuel Sensor
See the [Flex Fuel](Flex_Fuel "wikilink") section for details on hardware and configuration of flex fuel setups.
#### Oil Pressure
&lt;<placeholder>&gt;
#### 12V Input Signal
Some position sensors output a 12v signal. To correct this, and avoid damaging the Arduino, a circuit like the one in the diagram can be constructed. The resistor R1 is not always required, but will make sure that any output that is not high is pulled low. Along with this circuit use the pull-up jumper on the Speeduino. This will effectively change a 0v/12v into a 0v/5v signal.
![<File:Highvolthall.png>](Highvolthall.png "File:Highvolthall.png")
*Many thanks to PSIG for the info and diagram.*
#### GM 7 / 8 pin Distributor Module
The GM 7 /8 pin modules have been used in a wide variety of GM engines from 4 cylinder to V8s (small and big block). The 8 pin distributor was also widely used in marine applications by Indmar, Mercruiser, and others.
<center>
GM 7-Pin Module   <img src="https://raw.githubusercontent.com/speeduino/wiki/master/hardware/GM_7-pin.png" title="Fig. 1 GM 7-pin module" width="400"/>
</center>
<center>
GM 8-Pin Ignition Module   <img src="https://raw.githubusercontent.com/speeduino/wiki/master/hardware/GM_8-pin.png" title="Fig. 2 GM 8-pin module" width="370"/>
</center>
The 7 and 8 pin modules are functionally equivalent and largely share the same wiring. The 7 pin is used in the large coil-in-cap distributors while the 8 pin is used in the small cap distributors with remote mounted coils. The 8 pin has one additional terminal that provides a sensor ground. Both modules provide coil ground via the metal grommets used to secure them to the distributor.
These modules provide an simple means for computer controlled timing while retaining the distributor. They were designed to be used with throttle body injection and port injection motors and provide automatic coil current limiting (7.5 amps was the GM specification) and automatic dwell control. The can be adapted to other distributor applications that use either variable reluctor or hall type sensors.
##### Pin Descriptions and connections
• "**+**" : Battery voltage from a switched ignition source. Provides the power to operate the module.
• "**C-**" : Ignition coil negative connection.
• "**P & N**" : Positive and Negative of the distributor reluctor. Polarity is important. GM distributor connectors can only be connected one way. For use with other distributors, verify polarity of the reluctor leads.
• "**B**" : Ignition bypass. When cranking, grounding this line bypasses computer control of timing. The timing iscontrolled by the module only. This can be done using the Speeduino Cranking Bypass pin function (see below).
• "**R**" : Reference or tach signal. This outputs a 5 volt square wave that serves as the RPM1 input for the Speeduino. To use this, connect it to RPM1 and set JP2 to Hall and JP4 connected (ie, 5 volt pull up).
• "**E**" : Timing control signal. When pin B has 5 volts on it, the module allows Speeduino to control the timing using this pin. The output of Ign1 should be connected to this pin.
• "**G**": *(8 pin only)* Signal ground. Should be connected to the Speeduino sensor ground. (Module ground is provided through the metal mounting grommets)
A timing bypass circuit must be constructed to utilize the Speeduino ignition timing control. The small circuit below should be built in the proto area.
<center>
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/ignition/GM7_pin_bypass.png" title="Fig. 3 Bypass circuit" width="40%"/>
</center>
In addition, the cranking bypass should be turned on and the bypass pin should be set to pin 3 in the Cranking Settings dialog (under Starting / Idle in TunerStudio):
<center>
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/warmup/cranking_bypass.png" title="Fig. 4 Bypass settings" width="40%"/>
</center>
Trigger settings (under Starting / Trigger Setup in TunerStudio) should be as shown below. You will need to adjust the trigger angle to get correct timing. Instructions for this are in the wiki.
<center>
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/ignition/GM7_pin_triggerSettings.PNG" title="Fig. 5 Trigger settings" width="35%"/>
</center>
Timing control is set in the Spark / Spark Settings dialog:
<center>
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/ignition/GM7_pin_sparkSettings.png" title="Fig. 6 Spark settings" width="30%"/>
</center>
The module works well, however, some applications result in a noisy trigger signal. This shows as an unstable RPM (either at idle, or more frequently, at higher speeds). Trigger filtering may help, but a modification may be necessary to clean up the signal. The circuit below effectively cleans/filters the signal, allowing use with no trigger filtering by the Speeduino. It has been tested with single and 8-pole reluctors and modules from GM, Transpo and a no-name generic.
<center>
<img src="https://raw.githubusercontent.com/speeduino/wiki/master/ignition/GM7_pin_filter.png" title="Fig. 7 Filter circuit" width="40%"/>
</center>
*Many thanks to apollard for this outline information.*
Outputs
-------
### Injectors
Speeduino injector drivers use on/off (not PWM) control and are designed to work with "High-Z" injectors. This type of injectors are also known as "saturated" or "high-impedance" that use full battery voltage to control the injector open cycle, and generally the impedance is greater than about 8 Ohms. If you are running "Low-Z" ("peak and hold" or PWM-controlled) injectors that are lower impedance, you will need to install series resistors on these to avoid damaging the board with excessive current. The resistor ohms and watt rating can be calculated by Ohm's Law, or use an Internet calculator page such as the [Speeduino Injector Resistor Calculator](http://efistuff.orgfree.com/InjectorResistorCalculator.html).
Speeduino can drive up to 2 High-Z injectors per output channel.
### Coils
Current versions of the Speeduino use low-power output signals, designed to work with external small-signal ignition coil drivers, whether a separate type (module or ICM, igniter, IGBT, etc.), or built into the coil assembly ('smart' coils). This method permits Speeduino to have great flexibility to control most types of ignition systems. Attaching the Speeduino outputs directly to a traditional high current passive ("dumb" or 2-pin) ignition coil without an ignition coil driver WILL cause damage to your Arduino.
***How Speeduino controls ignition circuit power*** In prior history, the coil driver was a set of mechanical contact points ("points"), simply replaced today by an electronic version. The added coil driver can be anywhere from inside the Speeduino to inside the coil assembly; though near or in the coil reduces electrical noise.
In the example animated image below, the Speeduino ignition signal is normally low (near ground or 0V) while Speeduino calculates the time to the next coil firing. At the proper time, Speeduino switches the ignition output to high (near 5V or 12V selectable) in order to switch the coil driver (example IGBT) on, allowing current to flow through the coil to ground. This is called the 'dwell' period. During dwell an increasing energy field is generated around the ignition coil core and wire windings.
At the end of the dwell period and therefore at the proper time for spark; Speeduino switches the coil driver off, stopping current flow, which collapses the energy field to create high voltage and the resulting spark:
<img src="http://efistuff.orgfree.com/images/Speedy_Ignition_Sequence.gif" title="Fig. 1 Typical IDI Ignition" />
In TunerStudio, the setting for this example would be to fire the spark "*going low*". The dwell setting is highly variable depending on coil type, voltage levels, etc. Too little dwell will give weak or no spark and excess dwell will rapidly increase heat, possibly damaging any of the ignition components, but usually the ignition coil or coil driver.
The wasted-spark version is below to show how it is identical in operation, but with the high-voltage spark returning through the second spark plug to complete the circuit:
<img src="http://efistuff.orgfree.com/images/SpeedyIgnitionDiagramWASTED.jpg" title="Fig. 2 Typical ISI-WS Ignition" />
A good run down of 'smart' coil types can be found at: [<http://www.megamanual.com/seq/coils.htm>](http://www.megamanual.com/seq/coils.htm). There are many ignition modules available that Speeduino can use to control standard coils, or for smart coils you can generally use 4 or 5-pin types as these will always be logic level, although some 3-pin coils are also of this variety. GM LS1/2 coils are an example of powerful smart coils that are commonly used and can usually be obtained easily and cheaply.
*(Note: In the past, some ignition control modules with current limiting or dwell control features (e.g., 1970s GM HEI, Bosch '024' types, and Ford DS1) were referred-to as "smart" modules. While still true, common terminology of individual ignition coils with at least a driver integrated, or newer technology with greater controls (e.g., controlled spark duration or multi-spark) are all considered "smart" coils. You must know the control requirements of the specific drivers, control modules, or coils you intend to use in order to operate them properly with Speeduino.)*
### Aux Outputs
#### Low Current
Most Speeduino versions have low-current (LC) signal outputs directly from the MEGA processor to (usually) the prototyping (proto) area of the board. These outputs are generally not suited to control power devices directly in this form, and need suitable output circuits built on the proto area to enable their use. Alternatively, the output functions such as Fuel Pump or Fan are re-assignable to other pins and components, such as the existing HC [medium-current](Hardware_requirements#Medium_Current "wikilink") output MOSFETs.
Some Speeduino versions include an 8-channel ULN2803A Darlington transistor array IC that is capable of switching up to 1/2 amp per channel. These auxiliary outputs are sufficient to switch small devices directly, or to switch power-handling devices, such as power MOSFETs or automotive relays. Configuration and settings of these outputs is described in the [Configuration](Configuration_Index "wikilink") section. Additional information for using a ULN2803A on v0.4-series boards may be found [here](https://speeduino.com/forum/viewtopic.php?f=19&t=1023&p=16588#p16588). Similar output options and pin assignments may be used on other board designs.
#### Medium Current
v0.3x and later boards include medium-power MOSFET auxiliary outputs to switch up to 3 amps directly. These are labeled "HC" in schematics and some references. These outputs are commonly used to operate idle valves, boost-control valves, VVT solenoids, etc., or to control relays for handling much larger loads, such as electric radiator fans. Configuration and settings of these outputs is described in the [Configuration](Configuration_Index "wikilink") section.
Auxilary IO
-----------
On Arduino Mega2560 based Speeduino boards (official or just running current firmware) git commit 13f80e7 support is available for the external connection of 8 16bit analog inputs via [Serial3](Secondary_Serial_IO_interface "wikilink")
CanBus
------
As the Arduino mega2560 has no CanBus interface a seperate "co-processor" interface has been designed. More information about this unit can be found here <https://github.com/Autohome2/Speeduino-can-interface>. This uses the functionality provided by the Serial3 port and connects via that port.
On the upcoming Teensy3.5 variant of Speeduino the CanBus code will be incorporated into the main system firmware as the Teensy3.5 has integrated CanBus and only requires a transceiver module added.
Third Party Addon's
-------------------
In This section you will find information about third party designed hardware designed to be used in conjunction with the Speeduino ECU
GPIO for Speeduino
------------------
There are several variants of the GPIO , The firmware can be downloaded here <https://github.com/Autohome2/Speeduino-GPIO>
More information [GPIO_for_Speeduino](GPIO_for_Speeduino "wikilink")

33
Hardware_testing_page.md Normal file
View File

@ -0,0 +1,33 @@
Output Hardware Test Page
=========================
The output hardware test page offers the ability to test the Speeduino Output stages whilst the engine is NOT running only.
This is useful to check that wiring and actuator/output devices are functioning as intended. <img src="output_testing.jpg" title="fig:output_testing.jpg" alt="output_testing.jpg" width="500" />
By selecting "Enable Test Mode" button the option to activate other tests will become available.
By clicking on "Stop Test Mode" or upon closing the output test page , test mode will be disabled and all outputs returned to their default states.
Injector Driver Output Test
---------------------------
CAUTION !! Use care when testing injectors with this feature. If your fuel system has line pressure or the fuel pump is running you will get fuel flow into the engine which could cause serious starting issues or even hydraulic lock!(a very serious flooding of the engine bore resulting in potentially major engine damage)
Pressing "On" on the respective channel will activate that individual channels output stage.
Pressing "Off" will turn that channel back off.
Spark Driver Output Test
------------------------
CAUTION !! Use care when testing spark drivers with this feature. If you touch your HT circuit and it is activated by the spark driver you could receive a potentially lethal electric shock!! Leaving your coils charging for an excessively long period will cause them to overheat and may burn out!
Pressing "On" on the respective channel will activate that individual channels output driver stage.
Pressing "Off" will turn that channel back off.
Input Hardware Test Page
========================
coming soon!

55
Overview.md Normal file
View File

@ -0,0 +1,55 @@
So what's the go?
-----------------
The Speeduino project aims to create a fully featured, totally open source (Hardware and firmware) Engine Management System (EMS) / Engine Control Unit (ECU) on top of the [| Arduino Mega](http://arduino.cc/en/Main/arduinoBoardMega2560) platform. In order of priority the specific aims are:
- Low barrier to entry (ie price and availability of hardware, clear, well documented code, easily accessible software development etc)
- Capabilities / Features
- Simplicity of development
In short, the main goal is to be in all places as simple as possible. No weird build environments, no knowledge of assembly needed, favour simplicity over performance where needed and make as low a barrier to entry as can possibly be achieved. Both the hardware and software/firmware sides of the system are covered with all being covered under open licenses.
Current Feature List
--------------------
What you will get is flexible and configurable fuel and ignition management that will work for the majority of every day type setups. Currently supported features include:
- 16x16 3D fuel and ignition maps, with base of either TPS (Alpha-N) or MAP (Speed Density)
- Supports up to 8 cylinders fuel and ignition with 4 channels of fuel and 4 channels of ignition outputs
- 1, 2 (Even fire only), 3 and 4 cylinder engines with full sequential fuel and ignition
- 6 (even fire only) and 8 cylinder engines are supported with wasted spark and 2 squirts per cycle
- 6x6 3D individual cylinder trim on engines up to 4 cylinders
- After Start Enrichment
- Rev limiting (Spark based, hard and soft)
- Cranking specific enrichment, dwell timing and advance
- General logging through TunerStudio
- High speed tooth logging
- TPS calibration through TunerStudio
- Sensor calibration through TunerStudio (Coolant, IAT and O2)
- Warm Up Enrichment (WUE)
- TPS based acceleration enrichment
- Tacho output
- Fuel pump activation/deactivation (With priming)
- Over dwell and over duty protection
- Battery voltage compensation for dwell and injectors
- Modular wheel decoder support. Included decoders:
- Missing tooth (Eg 36-1, 60-2 etc)
- Dual wheel (Evenly spaced teeth on crank, single tooth on cam)
- Basic distributor
- GM 7X
- GM 24X
- 4g63 aka 4/2
- 'Jeep 2000'
- Audi 135
- Miata 99-05
- Honda D17 (12+1)
- Nissan 360
- Subaru 6/7
- Taking requests...
- Open and closed loop idle control (PWM and Stepper)
- Closed loop boost control
- Open loop VVT control
- Deceleration fuel cut off (DFCO)
- Launch control
- Flex fuel
- O2 based autotune (Registered version of TunerStudio required)

View File

@ -0,0 +1,332 @@
Overview
--------
The Arduino Mega2560 version of Speeduino supports the use of Serial3 for supplemetry IO.The proposed STM32 and Teensy3.5 versions use Serial2 . On a Mega 2560 Serial3 can be found on the board at pins 14 and 15.The connection speed is 115200baud.
Settings
--------
### Enable Secondary IO interface
To enable use of the Secondary io interface it must be enabled in TunerStudio.
Dependant on if CAN_COMMANDS have been enabled will vary the type of dropdown menu you will see
![](Auxindrop_nocan.jpg "fig:Auxindrop_nocan.jpg") ![](Auxindrop_withcan.jpg "fig:Auxindrop_withcan.jpg")
select option "Secondary Serial IO Interface" or "CanBus/Secondary Serial IO Interface" as appropriate.
### Secondary IO Configuration Options
Again dependant on if CAN_COMMANDS have been enabled will vary what options you have to enable Secondary serial.
![](EnableSecondarySerial_nocan.jpg "fig:EnableSecondarySerial_nocan.jpg") <img src="EnableSecondarySerial_withcan.jpg" title="fig:EnableSecondarySerial_withcan.jpg" alt="EnableSecondarySerial_withcan.jpg" width="700" />
- **Enable options**
- 1. Disabled
- 2. Enabled Secondary IO via Serial port
- 3. Enabled Secondary IO via canbus (this option will only be available when CAN_COMMANDS are enabled
How to use it
-------------
Depending on if the secondary port is a simple serial port or is a canbus port there are several things that the Secondary io interface is capable of.
- 1. Retreive the current realtime data in full from Speeduino just as is sent to TunerStudio.
- 2. Retrieve specific current realtime data from Speeduino.
- 2. Read in the Analog data values from 16 remote sensors as requested by Speeduino.
- 3. Acivate External Outputs(coming soon!)
Retrieve realtime data
----------------------
To get Speeduino to send out the realtime data to your device connected on a Secondary Serial IO port you must send either an "A" or an "r" to it.
- **Send an "A"**
If you send an "A" to the port it will reply with ,
"A" confirming the received instruction (sent as 0x41 in hex),
The port will then transmit ALL the realtime data.
- **Send an "r"**
if you send an "r" to the port you must also send 6 further bytes immediately after the "r". These are the Speeduino TS canID, the r type command 0x30(48 in decimal), a 2 byte offset and a 2 byte length. the offset is the position in he realtime list you want the data returned to start from and the 2 byte length is the number of bytes you want returned. the bytes are sent LSB first .
The port will reply with ,
"r" confirming the received instruction (send as 0x72 in hex) ,
The port will now transmit a single byte in hex ,this is the value of the "r" type command, confirming what was requested (this is typically 0x30).
The port will then transmit the realtime data requested starting at the byte position sent for the number of bytes length.
- *' The Realtime Data List*'
As of 05/10/2017 the data list is as follows
BIT 0 - currentStatus.secl
`     secl is simply a counter that increments each second`
1 - currentStatus.squirt
`     Squirt Bitfield`
2 - currentStatus.engine
`     Engine Status Bitfield`
3 - (byte)(divu100(currentStatus.dwell))
`     Dwell in ms * 10`
4 - lowByte(currentStatus.MAP)
5 - highByte(currentStatus.MAP)
6 - (byte)(currentStatus.IAT + CALIBRATION_TEMPERATURE_OFFSET)
`     mat`
7 - (byte)(currentStatus.coolant + CALIBRATION_TEMPERATURE_OFFSET)
`     Coolant ADC`
8 - currentStatus.batCorrection
`     Battery voltage correction (%)`
9 - currentStatus.battery10
`     battery voltage`
10 - currentStatus.O2;
`     primary O2`
11 - currentStatus.egoCorrection
`     Exhaust gas correction (%)`
12 - currentStatus.iatCorrection
`     Air temperature Correction (%)`
13 - currentStatus.wueCorrection
`     Warmup enrichment (%)`
14 - lowByte(currentStatus.RPM)
`    rpm LB`
15 - highByte(currentStatus.RPM)
`     rpm HB`
16 - currentStatus.TAEamount
`     acceleration enrichment (%)`
17 - currentStatus.corrections
`     Total GammaE (%)`
18 - currentStatus.VE
`     Current VE 1 (%)`
19 - currentStatus.afrTarget
`     chosen afr target`
20 - lowByte(currentStatus.PW1);
`     Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.`
21 - highByte(currentStatus.PW1);
`     Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.`
22 - currentStatus.tpsDOT
`     TPS DOT`
23 - currentStatus.advance
`     Current spark advance`
24 - currentStatus.TPS
`     TPS (0% to 100%)`
25 - lowByte(currentStatus.loopsPerSecond)
`     loops per second LB`
26 - highByte(currentStatus.loopsPerSecond)
`     loops per second HB`
27 - lowByte(currentStatus.freeRAM)
`     freeRam LB`
28 - highByte(currentStatus.freeRAM)
`     freeRam HB`
29 - currentStatus.boostTarget
`     Target boost pressure`
30 - currentStatus.boostDuty
`     current pwm boost dutycycle`
31 - currentStatus.spark
`     Spark related bitfield`
32 - lowByte(currentStatus.rpmDOT)
`     rpmDOT must be sent as a signed integer`
33 - highByte(currentStatus.rpmDOT)
`     rpmDOT HB`
34 - currentStatus.ethanolPct
`     Flex sensor value (or 0 if not used)`
35 - currentStatus.flexCorrection
`     Flex fuel correction (% above or below 100)`
36 - currentStatus.flexIgnCorrection
`     Ignition correction (Increased degrees of advance) for flex fuel`
37 - currentStatus.idleLoad
`     idleload`
38 - currentStatus.testOutputs
`     testoutputs bitfield`
39 - currentStatus.O2_2
`     Second O2`
40 - currentStatus.baro
`     Barometer value`
41 - lowByte(currentStatus.canin\[0\]);
42 - highByte(currentStatus.canin\[0\]);
43 - lowByte(currentStatus.canin\[1\]);
44 - highByte(currentStatus.canin\[1\]);
45 - lowByte(currentStatus.canin\[2\]);
46 - highByte(currentStatus.canin\[2\]);
47 - lowByte(currentStatus.canin\[3\]);
48 - highByte(currentStatus.canin\[3\]);
49 - lowByte(currentStatus.canin\[4\]);
50 - highByte(currentStatus.canin\[4\]);
51 - lowByte(currentStatus.canin\[5\]);
52 - highByte(currentStatus.canin\[5\]);
53 - lowByte(currentStatus.canin\[6\]);
54 - highByte(currentStatus.canin\[6\]);
55 - lowByte(currentStatus.canin\[7\]);
56 - highByte(currentStatus.canin\[7\]);
57 - lowByte(currentStatus.canin\[8\]);
58 - highByte(currentStatus.canin\[8\]);
59 - lowByte(currentStatus.canin\[9\]);
60 - highByte(currentStatus.canin\[9\]);
61 - lowByte(currentStatus.canin\[10\]);
62 - highByte(currentStatus.canin\[10\]);
63 - lowByte(currentStatus.canin\[11\]);
64 - highByte(currentStatus.canin\[11\]);
65 - lowByte(currentStatus.canin\[12\]);
66 - highByte(currentStatus.canin\[12\]);
67 - lowByte(currentStatus.canin\[13\]);
68 - highByte(currentStatus.canin\[13\]);
69 - lowByte(currentStatus.canin\[14\]);
70 - highByte(currentStatus.canin\[14\]);
71 - lowByte(currentStatus.canin\[15\]);
72 - highByte(currentStatus.canin\[15\]);
73 - currentStatus.tpsADC
`     TPS (Raw 0-255)`
74 - getNextError()
`     Error codes`
Read external analog data from a remote device
----------------------------------------------
To get Speeduino to read analog data over Serial3 or CANBUS you must enable it. this is done in TS on an per channel basis.
<img src="Canbus_input_config_new.jpg" title="Canbus_input_config_new.jpg" alt="Canbus_input_config_new.jpg" width="800" />
You set the Source Can address(this is the address of the remote device that you wish to source the data value from.This is not used in direct Serial3 connections), input start byte number,input parameter number of bytes according to the sensor being accessed. Once enabled and configured Speeduino will periodically poll for that device on Serial3
Using Example 1 this is how to get your remote device to reply to the request from Speeduino for data.
### IF the remote device is connected directly to Serial3.
Speeduino will send an "R"
Followed by the Can input channel that the data will be placed into , and then the Can address the data is to be sourced from(this is sent in two bytes LSB first). As your remote device is connected directly to the Serial3 port then you can ignore the Can Address.
### If the remote device is connected via CANBUS.
Speeduino will issue an "R" request for the Can address selected for the Can input channel.
Speeduino will now await the response.
### IF the remote device is connected directly to Serial3.
You must first send an "G" , Then a '1' to flag the cmd is valid, Then the Can input channel (this is the channel number that Speeduino issued with the request. Then send 8 bytes of data. The Data you wish to send is placed in bytes 0 and 1 (LSB and MSB respectively)if it is two bytes long or in byte 0 if it is only a single byte long .
### If the remote device is connected via CANBUS.
The remote device upon hearing its ID requested will respond to the Speeduino(at the address that was sent in the outgoing packet) with the Can input channel and 8 bytes of data.It is recommended that the Data you wish to send is placed in bytes 0 and 1 (LSB and MSB respectively)if it is two bytes long or in byte 0 if it is only a single byte long, but the data can be placed in any of the data bytes(just ensure that Speeduino is configured to read those bytes in the config table above.
The value sent is readable in Tunerstudio using the CanIN gauges

View File

@ -0,0 +1,6 @@
The below trigger wheel generator is provided and maintained by [Bad Apple Machine & Fab](http://www.badappleproducts.com/) for the benefit of the Speeduino community.
<center>
<iframe key="trigger1" path="TriggerWheel" width="100%" height="1200" />
</center>

10
Tuning_Index.md Normal file
View File

@ -0,0 +1,10 @@
Tuning
======
*The Tuning section is to set operating parameters and adjustments in Speeduino using the TunerStudio interface for correct and best operation. Tuning is application specific and to a particular use. Some references to the Configuration section will be necessary.*
The major tables that require tuning are:
- - [VE Table](tuning "wikilink")
- [Spark Table](Spark_Table "wikilink")
- [AFR Table](AFR_Table "wikilink")

12
Wiring.md Normal file
View File

@ -0,0 +1,12 @@
Overview
--------
Information on connecting Speeduino to the given circuits in a car can be found below. Any suggestions, corrections or additions are welcomed (Please post on the forum)
Wiring Index
------------
- [Injector wiring](Injector_wiring "wikilink")
- [Ignition wiring](Ignition_wiring "wikilink")
- [Analog Sensor wiring](Analog_Sensor_wiring "wikilink")
- [Aux wiring](Aux_wiring "wikilink")