Well it has been a long time coming so here is the embedded software design.
The Plan: The Arduino must send and receive information asynchronously, via the byte serial USB host connection, on Port 1.
This connection
- It must receive and respond to the RSS_IOP commands
- It must send data to the RSS_IOP when something changes
- Basicly you need 1 Arduino Mega per tuner. It has lots of Digital I/O, and its cheap!
- The protocol must be easy and expandable for all types of radios.
Since a physical radio can have multiple tuners (Figure 1), you must use the command lsusb() to display the information of the devices. As this is different for every radio and each
computer is different at this time you must manage this in the RSS_IOP software. This Protocol has three (3) Byte Message.
The Protocol: There are two sides to the Protocol and I will describe both sides. This is documented fully in the Protocol Manual.
Basic RSS_IOP Discriminants
Read Frequency * .01
0
Read Frequency *.1
1
Read Frequency * 1
2
Read Frequency * 10
3
Read Frequency * 100
4
Write Dial Lamp
10000005
Write Aux Meter
Write Aux Lamp
The RSS_IOP can send the following commands:
Message Format to the Interface Processor
0-7
8
9-15
16-23
!
0/1
Start
R/W
Discriminant
Payload
- Read Tuner Radio Frequency
- Read Tuner Power Switch
- Read Radio Special Switches (see notes per radio)
- Write Tuner Radio Dial Lamp(s)
- Write Radio Special Lamp(s) TBD (see notes per radio)
- Write Power Flags in Instruments TBD (see notes per radio)
- Write Meter Output on Radio(s) & in Instruments TBD (see notes per radio)
The Interface Processor (Arduino) can send the following messages:
(only when something changes,) ie. No Change, No Message.
During the RSS_IOP start up, the Interface Processor will send a start message "!!!" followed by initial values of all that tuners Discriminants and payloads.
Basic Interface Processor Discriminants
Power
0
Frequency * .01
1
Frequency * .1
2
Frequency * 1
3
Frequency * 10
4
Frequency * 100
5
Aux Meter
(see notes per radio)
Aux Switches (see notes per radio) Message Format
0-7
8-15
16-23
!
START
Discriminant
Payload
Frequency
- Switches, Power
- Meter, Aux, TBD (see notes per radio)
- Switches, Aux, TBD (see notes per radio)
The Software: There are several steps in writing this software. As C programer I like to put things in a .h file so the file is C3436A.h the body of the my code is in C3436.ino the reason why your use multiple files is to logically manage your program. ( As of yet I can not show my finished code - CAH)
~~~~ Cris
PS!! I will be at Cockpit Fest 2014 August 29, 30, 31!! @ Lancaster Airport, So if you live in the Dallas, Fort Worth Metroplex come down and say hello....
PS. I wish to thank Paul Z. for the review of this document. 8/2/2014
Top Comments