Pages: [1]   Go Down
Author Topic: Arduino as a translator between dissimilar control software and hardware?  (Read 616 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Howdy all, first time poster here.

A couple months back I picked up an Arduino Uno and a Mega 2560, as well as a couple introductory kits.  I have some limited experience with the BasicStamp and other very elementary BASIC language application.  I scratch built a couple of simple autonomous robots based on the BasicStamp a few years ago.  I am a hardware guy but light on software background, so my software skills are pretty weak, but I try to work my way through things.

I have been running through the basics with the Arduino.  Blinking the LED, sensing temp, accelerometers, a ground up effort using a sensor suite (battery voltage, solar cell voltage, status of the charger / controller, temperature, barometric pressure) and report the results via simple Part 15 compliant RF link (the results are output as Morse code and key the transmitter to send the code).  Small things that have so far been pretty straight forward.

While playing around and trying to learn how to apply serial communications and control of the Arduino the other day it struck me that I might have a project in the making.

I have a hardware obsolescence issue that I am trying to resolve.  A piece of software that controls/interfaces to a radio receiver via a serial link is available, the source code is not available but the serial communications specification is.  So I know how it talks to the radio it is trying to control.  I want to use this to control another radio, one with a different, but also known, serial protocol.   This other radio is an orphan, the vendors GUI has not been updated in 10 years and will not run on any modern OS, but the basic hardware is still quite capable.  Both are RS232 but have different data structures.

The basics of the original radio the software is written to control and the radio I want it to control are similar, turn the radio on, tune the freq, set the receive mode, report back signal strength, etc.  Essentially every action I need the radio to do the software already tries to do, but in a different format.

Would it be practical to use an Arduino (maybe 2, one configured for each end of the link) to communicate with the software, emulating the radio the software is configured to control, and then pass the commands on to the dissimilar radio I want to control?  This seems like it would not be a huge deal, but I have a VERY limited understanding (yet) of how the Arduino handles serial data and if it would be capable of working with 2 full serial ports at the same time.  I saw the Two Port Receive example in the Tutorial section, but that seemed to indicate it would have to alternate listening on each of the two serial ports.

Looking for thoughts on this before I dive in too deep.

Thanks
T!
Logged

New Jersey
Online Online
Faraday Member
**
Karma: 72
Posts: 3758
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In theory it sounds plausible enough. Using a Mega, you have four UARTs available; on the Uno you would have to use softwareSerial to emulate a second. Unless there is some timing critical responses or a complex protocol, both of which I doubt, it should not be very difficult either.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17305
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well the arduino mega board has four hardware serial ports and the arduino hardware serial software library is fully buffered and interrupt driven so you would not have any problems handling two active links working at the same time. The Uno board has only one hardware serial port and it's somewhat taken up by the USB serial converter chip used to upload sketches or to send data to and from the serial monitor function in the IDE. There is also a software serial library you can use to allow serial comm on any two pin on either the uno or mega board but it's not quite as powerful and flexible as the hardware serial ports. So your first task is to buy or build a couple of RS232 to TTL level converter modules as the arduino serial ports cannot handle the RS-232 voltages directly. Most such converter are based on a max232 chip or similar.

And yes the software task will be much more involved then getting the hardware links working.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks much for the info.  I have only been working with the Uno so far, the Mega I got is still in its original unopened box and I have not looked at the differences between the two.  I guess it is time to break it out.  I did suspect (knew with the Uno) I was going to have to convert levels, fortunately, I have several MAX232’s laying around in the parts drawers.  One thing I was considering looking at was the RS232 Shield, just another excuse to order and play with toys smiley-wink

T!
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you want to consider yet another software solution: virtual system? You can download cisco virtual box and install an old operating system in the virtual box.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you want to consider yet another software solution: virtual system? You can download cisco virtual box and install an old operating system in the virtual box.

Operating the radio is not really a problem.  I have an old machine (Slot 1 300 MHz Pentium) running an old OS (ME, the GUI will run under XP but with reduced functionality) that runs the 10+ year old GUI for now.  What I want to do is take advantage of features that newer software brings to the table.

T!
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7303
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I see. I don't see a problem with this project, especially with the low baud rate you mentioned. I suggest Max233. It needs no external capacitors:

http://datasheets.maximintegrated.com/en/ds/MAX220-MAX249.pdf
Logged


Pages: [1]   Go Up
Jump to: