utilizing the I2C bus ...

  • 2
  • Idea
  • Updated 3 years ago
  • (Edited)
I have been using the Arduino I2C serial data bus in many engineering applications. I teach Robotics in our STEM program and have enjoyed the possibilities afforded by the I2C and SPI implementations. It would seem many of the requests here on this forum for controlling peripheral equipment can could be met by parsing an I2C string and interfacing via relay matrix, USB, RS232 output.

The I2C signals are available on the ACC port so it is a reasonable request. And, in the spirit of amateur radio (from days of yore when amateurs desired to craft their own), this would be a great opportunity to learn the Arduino micro-controller and very, very rudimentary C-language programming.

And fun ...

Just thoughts from the island ... waiting for 15-meters to settle in.

W7NGA  dan
San Juan Island, Wa.
Photo of W7NGA

W7NGA

  • 403 Posts
  • 166 Reply Likes

Posted 3 years ago

  • 2
Photo of Mark - WS7M

Mark - WS7M

  • 994 Posts
  • 354 Reply Likes
Hi Dan,

Used to live in Seattle and know San Jaun reasonable well.

I agree with your request and idea.  I am a software engineer by trade and getting back into ham radio with the flex opens lots of ideas.  I am currently a little frustrated by the difficulty to patch all the different programs together and get everything talking.  I currently use Ham Radio Deluxe and about 1/2 the time when I decide to use Digital Master it is not talking to the DAX channel and everything needs a restart.

Without any doubt computer control of radios and stuff has come a very long ways but I think there is more that can be done.  I second your idea!

While I am new to flex I am curious about interfacing to it.  While SmartSDR is cool it is designed for presenting a UI and allowing control that way.  I might want to have  a program that does things in a little more automated fashion.  Beyond the CAT commands which I found I have no idea what else is possible.

Mark
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
Hello Dan,

for integration purposes you could give a look at the official FlexApi libraries. They already implements every Flex ethernet protocol or, if you like the Arduino world, you could give a look at my very simple Arduino Flex library implementation. You need an ethernet shield, because I didn't used I2C and SPI, but using a primitive event driven system you can control your peripheral equipment.

73' Enzo
iw7dmh
(Edited)
Photo of Jon - KF2E

Jon - KF2E

  • 638 Posts
  • 189 Reply Likes
Enzo,

Have you figured a way to provide BCD data to external devices? I use a Yaesu Quadra and the only way to control it is via BCD.

Jon...kf2e
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
Yes of course!

Probably it'll be a part of my next project. As you can see in the picture below there is a fully programmable 8-channel relay board next to three hardware serial ports that will implement the CAT protocol.

I am having two problems at the moment:

- the first is downgrading my libraries to the 8 bit AVR platform. Using a Mega board I could use additional virtual serial ports to get/send data from/to rotators and amplifiers;
- the second one is deciding the best language for the client (and remote) application. I am strongly oriented to use Java and in these days I am testing a RS-232 package on MAC, Linux and Windows operating systems. It is doesn't work I'll have to use a simple Win32/64 application because my idea is running my client next to SSDR.

There are one thousand of things that can go wrong and I don't know if everything will work, but the way I would like to use my Flex is "next to ... no PC". And the only way to find this out is to find out.

73' Enzo
iw7dmh 



 
Photo of Jon - KF2E

Jon - KF2E

  • 638 Posts
  • 189 Reply Likes
This is exactly what I was hoping someone would develop. When you get it working please document it so that others can use it. I would even be willing to contribute.

Jon...kf2e
Photo of Tim - W4TME

Tim - W4TME, Customer Experience Manager

  • 9148 Posts
  • 3467 Reply Likes
Since it is network based, a browser interface might be suitable.
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
Yes, this is the best solution at all, and I'll leave it as my last chance for multiplatform solution.
What I am going to do is adding also my remote cw key. In the actual version, the key is connected to the CTS line of a RS232-Port and a very simple program send udp packets over the network to the remote Arduino board. I don't know if an Html browser or a Javascript library can be used to connect a serial port, but I'll do some  search for it.
Photo of KY6LA - Howard

KY6LA - Howard, Elmer

  • 3541 Posts
  • 1396 Reply Likes
You can always fall back to using DDUTIL which provides automatic interfacing to most peripherals.. Not as elegant as a dedicated Arduino micro-controller But it provides things lick BCD outputs.  I definitely would not use HRD to control peripherals or my radio.

I have a virtually totally automated system optimized for remote operations which a number of Antennas, Antenna switches, Amp, Digital Wattmeters, Rotor and of course a SteppIR.  I have been using DDUTIL to automatically control all these for years now.  It is very easy to set up and runs reliably.  
Photo of W7NGA

W7NGA

  • 403 Posts
  • 166 Reply Likes
I apparently have plebian requirements <grin>

A relay matrix would be adequate for my needs.

The Arduino is a real hoot. I've been on a nostalgia trip lately and dusted off the Vibroplex 'bug' keyers to use on CW. The Flex keying input (debounced) doesn't tolerate the extreme contact-bounce from the dit contacts and the results were not 'air-worthy'. A large capacitor helped, but marginally so. Arduino to the rescue!

Now, no contact bounce and enforcement of a minimum dit-interval makes something lovely to listen to. Well .. on a good day!

73's

W7NGA  dan
San Juan Island, Wa.

// W7NGA Vibroplex bug keyer debounce program
// debounce extreme mechanical dit bounce
// detect state change and ignore < 10ms transitions

const int keyerPin = 2;   
const int codePin  = 3;     
const int ledPin   = 13; // onboard LED

int keyerState; // the current reading from the input pin
int lastcodeState = 1; // input floating high
 
 void setup()
  {
  pinMode(keyerPin, INPUT);
  pinMode(codePin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(codePin, lastcodeState);
  digitalWrite(ledPin, 0); // LED off
  }
 
void loop()
{
while(true)
 if (digitalRead(keyerPin) != lastcodeState)
         if (digitalRead(keyerPin) != lastcodeState)
         {
           digitalWrite(codePin, lastcodeState = (lastcodeState == 1) ? 0 : 1);
           digitalWrite(ledPin, lastcodeState == 0 ? 1 : 0);
           delay(50); // holdoff time after bounce
         }
}
(Edited)