Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

utilizing the I2C bus ...

W7NGA
W7NGA Member ✭✭✭
edited July 2018 in New Ideas
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.

Comments

  • Mark_WS7M
    Mark_WS7M Member ✭✭✭
    edited March 2016
    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
  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited July 2018
    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
  • Jon_KF2E
    Jon_KF2E Member ✭✭
    edited October 2015
    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
  • KY6LA_Howard
    KY6LA_Howard Member ✭✭✭
    edited January 2017
    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.  
  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited December 2016
    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 

    image

     



  • Jon_KF2E
    Jon_KF2E Member ✭✭
    edited October 2015
    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
  • W7NGA
    W7NGA Member ✭✭✭
    edited January 2018
    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
             }
    }
  • Tim - W4TME
    Tim - W4TME Administrator, FlexRadio Employee admin
    edited December 2016
    Since it is network based, a browser interface might be suitable.
  • IW7DMH, Enzo
    IW7DMH, Enzo Member ✭✭
    edited December 2016
    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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.