Forcing hardware serial with TicSerial on arduino

Hi,

Im having trouble getting TicSerial library to use hardware serial only and not software serial on a Arduino Pro Mini to control a Tic T834.

Using the SerialPositionControl example sketch I followed as instructed from line 1378 in tic.h :

  /// For example, to use the first open hardware serial port to send compact
  /// protocol commands to one Tic, write this at the top of your sketch:
  /// ```
  /// TicSerial tic(SERIAL_PORT_HARDWARE_OPEN);
  /// ```

Doing this the sketch fails to compile with:
'SERIAL_PORT_HARDWARE_OPEN' was not declared in this scope
Same error occurs even after commenting out the #define and #include for software serial.
Unplugging the serial programmer from the ProMini and wiring right to the HW serial pins it still reverts to using SW serial.

Any suggestions?
Thanks! :smiley:

Hello.

The SERIAL_PORT_HARDWARE_OPEN is most likely not defined in the pins_arduino.h file for your board version. You can just use Serial by replacing TicSerial tic(ticSerial) with TicSerial tic(Serial) or defining ticSerial as Serial before the tic definition.

Please note that the Arduino Pro Mini board only has one serial port so there could be difficulties when using the hardware serial port to upload sketches to the board.

- Amanda

Thanks Amanda!
I had a feeling pins_arduino.h was causing the issue since I’m using a 3rd party Pro Mini clone. (In Arduino IDE, clicking Get Board Info returns “Unknown board”)
The sketch complies successfully now so that ought to do it. I’ll upload and give it a test later.

I’m currently prototyping a wireless focusing gear for my camera rig using two HM-10 bluetooth modules to make a transparent UART bridge between the Tic834 to run the gear motor, and the Pro Mini as the handheld remote. Over physical connection SW serial works fine, however over wireless the Tic was throwing serial format errors continuously and input response unstable and laggy. I figured this was due to a SW serial limitation hence why I wanted to try HW serial instead. Might have to add another Pro Mini on the Tic side to offload the serial processing if it winds up being a bluetooth issue.

Thanks again for your help! :smiley:
-Mike

Just for added clarification and for those who might be following this thread, the issue is not specific to your board being a clone; the issue is specific to the ATmega328 chip, which only has one serial port and no other available hardware serial ports.

- Amanda