Getting started with inputs

So after testing the Max7219 drivers and getting all desired digits to work, I gave Inputs a try. So the goal was to “migrate” my already working OpenCockpits instruments to SimVim.

In order to reach that goal, the easiest would have been to make OC’s Inputs card somehow compatible with SimVim, meaning I’d just need to find a way, of connecting the multiplexer cards. Well – it turned out, that the pin positions don’t correspond with the actual “Input” pin. In fact, they seem to be completely random (I guess they are not, but I didn’t really bother yet to dig deeper).

So instead I disconnected the wires of my transponder from the Screw Terminal crimped them and put a connector on them to try it out.

For the transponder we are talking about the following components, which needed to be connected and configured:

  • 1 Momentary Push botton (used for IDENT)
  • 2 rotary Encoders (used for outer and inner Squawk)
  • 1 Rotary switch (Used for modes)

After hooking them all up to the breadboard I gave SimVim’s configurator a go, created the config, fired up X-Plane AAAAANDDD it worked. At least thats what I though initially. The rotary switch – well – switched through the modes. But when hitting ‘TA/RA’ (which was configured to be on ‘C5’ of the multiplexer Board, SimVim got input from IDT, which was configured on channel 9. I checked and double checked the wires an connectors, but only the ones from the instrument to the multiplexer board. It turned out,did a mistake hooking up the address lines to the multiplexer board, resulting in mixed up addresses. So, instead of address 0101, Arduino got 1001. In the end I decided to redo the wireing completely and the problem was solved (to be honest, I really need to improve my cable management).

It still looks like a mess, but hey, at least it worked!

After I had my SimVim config done and everything looked good that far, I also connected the 4 digits I previously used with the transponder to the prototyping PCB. Last time I soldered one Max7219 driver to a blank PCB, added some male pin header and starter connecting Segments and digits. As you could see in my previous post, I already had the segments working that far. I added them to the config and hey – I got my transponder working again!

Since this is just a prove of concept, I’m looking forward to redoing all cables, connectors, etc. in a nice, clean way.

Getting started

Ok, here we go. 2 weeks ago I ordered a Arduino Mega which arrived within 2 days. After unpacking I installed the software following the installation guide and that was it!

The first problem I want to get out of the way is how to drive 7 Segment Displays! For that I ordered a couple of Max7219 display drivers. Initially I planned on using SN74HC595 and multiplex the 7 segment LEDs. I even had a working setup, which I implemented with an Arduino UNO + some NPN transistors (even though it took me a while to understand how Transistors even work :D). Well in the end I managed to get 4 7 Segment LEDs running with just 1 IC! Great!

One on of the very first tests looked like that (with 2 Segments connected)

BUT; there was a problem. The 74HC + NPN transistor solution worked as follows:

  • Set LatchPin LOW
  • shiftout Data via Output to ClockPin
  • Set LatchPink HIGH
  • Turn on first LED (by setting the Output pin connected to the first transistor to high)
  • Wait 2 ms turn LED off and continue with second Number + LED

As you may notice the information about every number I wanted to have displayed was sent via 1 Output pin (the one connected to the CLK pin). Which 7 segment LED was actually used to display [meaning which LED was to be turned on] this specific number was controlled via another OUT pin.

SimVim uses a different logic:

The configured Output pin is the connection to the CLK pin of the IC / driver, there would be no way to multiplex 7 Segment LEDs with just 1 IC. Since I used the 74HC ICs I’d need to use 1 IC per LED.

This is how I ended up buying a couple of Max7219 drivers. These drivers are pretty expensive, compared to the shift register I used before (around 8€, compared to around 0,50 €), but you can control up to 8 Digits with just one driver. They arrived at the end of last week, soldered one onto a protoyping board and it worked! (Pictures follow)

So for the moment I’m trying to figure out a nice way of soldering and wireing the LEDs: