Software Serial


#1

Good Day All,

Has anyone implemented software serial on the controller board to make some of the digital pins into a serial bus? If, so, can you provide any tips on what is required to do so? I’ve used this on my Arduinos for other projects. I’m just trying to understand how it works in this OpenROV environment with including the library.

Thanks,
Mike


#2

Hi Mike:

The hardware support for additional serial ports is definitely there. The hardware design of the controller board was modeled after the Arduino Mega, and we chose to bring pins out to the prototyping headers based upon their capabilities on the Mega. In looking at the pinout of the headers (Sheet 2 of the Controller Board schematic), IIRC the pins D2-D5 and D14-15,D18-19 were brought out specifically because they had the capability of being used as serial ports.

So you’re going to have to write some custom code that utilizes some of these pins as a serial port, and include it in the Controller Arduino code. The tougher bit is then passing that data to the BeagleBone and then to the browser. This has been discussed before; if you do a search there should be some threads about how to port an Arduino program to the OpenROV. Our concept from the beginning was that one should be able to do development on an Arduino Mega, then port it to OpenROV by replacing calls to the terminal session with calls to the OROV telemetry stack.

Another possibility is to utilize the spare serial ports that are on the BBB. If you’re a JavaScript programmer that may be an easier thing to do.

-W


#3

Thanks Walt! I got everything working. It was quite simple to get the second serial port using Serial1 on D18 and D19. I figured out how to send commands over it by looking at the depth and heading hold buttons.