Application and configuration Notes:
2x6 Antenna Switch Controller Written By Ed Clark WD4ED 11/30/2017
For Arduino UNO and MEGA
Firmware and Windows Form application are intended to work with several existing 2x6 Hardware solutions already on the Internet.
For the purposes of this firmware/software operation all that is required is an Arduino UNO/MEGA2560, a standard Arduino Ethernet shield
and a Networked PC. Windows Application requires MS Framework 4.7.1 or later. I intend on using a cheap wireless bridge to make my 2x6 switch "wireless'.
*Standard Arduino Ethernet shield pin usage. 13, 12, 11, 10, and Pin 4 if SD card slot use is desired.
But is currently not supported in this application.
*Allows control of 2 Radios connected to 6 Antennas. Allows any non-conflicted combination of Radios and Antennas
*Active antennas are locked out to the opposite radio.
*Receive data format (input to Arduino from Windows software via Ethernet) is "<R1A1>". Which would set Radio 1 to Antenna 1.
*9600 Serial data rate by default.
*if relay is not already in use and pin toggle is successful the new radio/antenna combination is returned to the Ethernet port if connected
or Serial port. Or both if both are configured.
*Return format (Data from the Arduino controller back to the Windows application via Ethernet) is "1,1,2,2\n\r". Or "Radio1#,Ant1#,Radio2#,Ant2#\n\r".
This allows the Windows application control states to be determined by the actual relay states.
If you cannot select an antenna it is locked out.
If you can select the same antenna for with both radios.... you are not connected.
*Setup tab allows for basic IP/Port configuration. No hostnames.
*Other options are "Always On Top" and "Connect on Start". "Always on top" should be obvious.
"Connect On Start" is only for use after the local configuration is working and stable.
Otherwise connection timeouts will become annoying.
*Last known pin states are saved and restored during reboots via AVR flash. Writes occur immediately after each successful configuration change.
But only if there are actual changes. This is an attempt to cut back on needless EEPROM writes.
*Simple debugging window assists in troubleshooting.
Bugs, Comments or suggestions to edclarkiv1@verizon.net
This sketch works on an Arduino UNO but with an Ethernet shield most of the digital capable pins are used.
Pins 0 and 1 are tied to the Serial port. That leaves only A5 open for potential use.
Using an SD card via flash would require at least pin 4 reassigned to probably A4 or A5. UNO is a tight fit.
Suggested Pin usage:
High select Antenna 1, Two Relays Pin 2
Radio 1 LOW, Radio 2 HIGH, Antenna 1 Radio Relay Pin 3
High select Antenna 2, Two Relays Pin 4
Radio 1 LOW, Radio 2 HIGH, Antenna 2 Radio Relay Pin 5
High select Antenna 3, Two Relays Pin 6
Radio 1 LOW, Radio 2 HIGH, Antenna 3 Radio Relay Pin 7
High select Antenna 4, Two Relays Pin 8
Radio 1 LOW, Radio 2 HIGH, Antenna 4 Radio Relay Pin 9
High select Antenna 5, Two Relays Pin A0
Radio 1 LOW, Radio 2 HIGH, Antenna 5 Radio Relay Pin A1
High select Antenna 6, Two Relays Pin A2
Radio 1 LOW, Radio 2 HIGH, Antenna 6 Radio Relay Pin A3