The general purpose input/output (GPIO) board is an expansion board for MegaSquirt-II. It provides a number (up to 25) of additional inputs and outputs for MegaSquirt-II. The additional I/O lines are communicated over a CAN (controller area network) which allows communication between the GPIO and MegaSquirt-II. This allows there to be just two wires connecting the MegaSquirt-II and the GPIO, while still sending any number of I/O signals.
There's nothing electronically new on the GPIO board; the CPU, CAN, and clock circuits are straight from MegaSquirt-II, the power circuit is from the V3 main board, the serial circuit is from the V3 main board as well.
The 'features' of GPIO are:
where MegaTune is connected to the network over the one serial line, and the main board receives and relays messages over CAN and back to MegaTune.
The GPIO setup scheme is designed to be extremely flexible. There will be an easy to use compiler to set the GPIO configuration, allowing the user to set things like port PWM, frequency measurement, map inputs to functions or tables, and all the outputs with a number of arbitrary conditions and functions that can be linked together to form very complex relationships, if needed. The current plan is to make it work like EasyTherm, generate a modified .S19 file with this code embedded in it, and spit out a customized .INI file at the same time. Below is an example nitrous controller, but you'll get the general idea, the transmission controller software ("MegaShift") will be more complex but similarly structured.
//------------------------------------------------------------------------------ INTERFACE [Menu] menuDialog = main menu = "&Settings" subMenu = nitrousControl, "&Nitrous Control" [UserDefined] dialog = nitrousControl, "Nitrous Control" topicHelp = "http://www.mysite.com/nitrous.html" field = "Lower RPM Limit", nc.rpmLimit field = "RPM Hysteresis", nc.rpmHysteresis field = "Low Coolant Threshold", nc.lowerCoolantThreshold field = "Coolant Hysteresis", nc.lowerCoolantHysteresis field = "Throttle Threshold", nc.throttleEnable field = "Throttle Hysteresis", nc.throttleHysteresis END_INTERFACE //------------------------------------------------------------------------------ tpsADC = PORT( 3, ADC); nitrousEnable = PORT(12, OUTPUT, OFF); // Output to solenoid armSwitch = PORT(18, INPUT); // Toggle switch on dash #define MS2 0x01 #define GPIO 0x02 rpm = CAN(1, MS2, 4); clt = CAN(1, MS2, 8); tps = (tpsADC-124) * 100 / 893; // Hard coded TPS calibration for example. //------------------------------------------------------------------------------ BLOCK nc rpmLimit = CONST(3500, "rpm", 1.0, 0.0, 0, 8000, 0); rpmHysteresis = CONST( 100, "rpm", 1.0, 0.0, 0, 1000, 0); lowerCoolantThreshold = CONST( 150, "°F", 1.0, 0.0, 0, 300, 0); lowerCoolantHysteresis = CONST( 5, "°", 1.0, 0.0, 0, 30, 0); throttleEnable = CONST( 75, "%tps", 0.1, 0.0, 0, 100.0, 0); throttleHysteresis = CONST( 10, "%tps", 0.1, 0.0, 0, 10.0, 0); nitrousCond1 = rpm >= rpmLimit : rpmHysteresis; nitrousCond2 = tps > throttleEnable : throttleHysteresis; nitrousCond3 = clt > lowerCoolantThreshold : lowerCoolantHysteresis; nitrousEnable = armSwitch && nitrousCond1 && nitrousCond2 && nitrousCond3; END_BLOCK //------------------------------------------------------------------------------ |
For off-the-shelf control, we hope to stock a number of 'pre-built' config files (4L60E/4L80E, for example) and code so that people don't have to invent them.
The serial connector is NOT the primary connection to the system, most communications (everything other than re-flash) will typically be done over CAN to the main board, including configuration and datalogging.
Unlike MegaSquirt® EFI Controller, the GPIO Board does not use a DB9 connector for serial communications. Instead it uses a 2.5 mm (aka. 3/32") sub-miniature stereo jack, of the same spec used for the Innovate LC-1 wide band controller:
This was done because the serial connection is used much less frequently with the GPIO board than with MegaSquirt® EFI Controller, and it allows the serial connection to be sealed. (Optionally, the serial connections can be brought out through the AMPSEAL connector.)