To build input/output controls with SimVimCockpit Interface you can use Arduino Mega as a controller board for SimVim firmware, which you need to upload from the plugin menu. The firmware is essential part of SImVim interface, and provide all input/output functionality together with SimVim plugin.
As in all our previous interfaces, the board pins can be used for inputs directly (one pin - one switch). Additionaly, SimVimCockpit allows you to extend number of inputs and have hundreds of toggle switches, buttons, encoders, that guarantees that you can make a full set of input controls for any complex cockpit.
To implement this we have chosen cheap CD74HC4067 multiplexer breakout boards, which allows you to have 16 inputs on any controller pin.
This extension method is much cheaper and more reasonable than adding Arduino boards just to have more pins, it is much easier to implement than the matrix expansion method, and this allows you to create a modular, bus-organized system.
CD74HC4067 multiplexer works as multiposition switch (or 16 relays), when only one of the 16 terminals is connected to the signal (SIG) pin at any given time. The 4 address inputs on this board (S0...S3) are used to select one of 16 ports (0..15) to be connected.
So, to extend number of inputs to 16 just connect the "SIG" terminal to an input pin thet need to be extended, and wire S0-S3 lines to the address bus.
- To organize output to a number of 7-segment displays or stepper motors, the same CD74HC4067 module is used, but controlled as output multiplexer. One muliplexer controls up to 16x 7-segment displays, another one used to control 16 stepper motors.
- If you have very few annunciators, you can use any pin directly as digital output. Along with direct output, in SimVimCockpit you can control as many additional LEDs or other digital outputs as you need, using DM16A driver or other registers for each group of 16 LEDs, as described on this page >>>
- For PWM-controlled devices (up to 24) you need to get one TLC5947 breakout board, that is a good 24-channel PWM controller with 12-bit PWM outputs, read more here >>>
Note that several pins are reserved for "Control Port". Pins #22 ... 25 are used as four address lines S0 ... S3 for all multiplexers (input and output) used in the system. Other controls are used for outputs only:
The SimVim firmware is a highly optimized program code that should synchronize control of large number of different input/output devices. SimVimCockpit interface doesn't allow to use controller board as "usual" Arduino and users can't add any custom code, as there is no Arduino sketch anymore, and the plugin uploads firmware directly to the board. For this moment we are using Arduino Mega only as convenient controller platform for SImVim firmware.
In the previous interface there were cases when users included their code that took hundreds of milliseconds (when the whole ArdSimX loop was only 1-5ms) and this ruined concistentcy of ArdSimX code (encoders stopped working correctly, all gauges output sequence on steppers was fully disrupted, etc.)
In SimVimCockpit you can make almost everything without the need for additional coding. The Interface is supposed to be self-sufficient in creating any I/O configuration, as it will support a large variety of I/O devices, and the ability to provide conditions for complex interaction of these devices with simulator data and each other.
But, it is also planned to include the option to connect a slave board to the master Mega where you can do whatever you want. The slave board is supposed to be "clean", not containing any of SimVimCockpit functions besides data exchange.