How does Maestro Mini choose baud rate for TX

Hello,

I’m a happy new user of a Maestro Mini, and have a Qik motor controller connected to its TX line. The Maestro runs in USB Dual Port mode. I control the motors both from a computer (through /dev/ttyACM1) and from Maestro scripts using serial_send_byte.

I sometimes have problems with noise on the serial line from the Maestro to the Qik. The problems go away if I lower the baud rate, but I’m a bit confused how this works:

According to the manual, when I open /dev/ttyACM1 on the computer, the baud rate I set on this port actually determines the baud rate used by the Maestro to send on its TX line (and this indeed seems to work fine - lowering the baud rate to 9600 fixes the noise problems).

But how does the Maestro choose the baud rate for transmitting on TX when it is not connected by USB? (That is, I run the Maestro stand-alone in script mode, and control motors using serial_send_byte.)
The manual doesn’t seem to say anything. The MaestroControlCenter has an option for setting a fixed baud rate in the “Serial Settings” tab - but this is active only in UART mode (and I’m using USB Dual Port mode). Does the setting there apply anyway if USB is not active? Or does the Maestro use a fixed baud rate? Or remember the last active baud rate?

Thanks for any help!

Here’s how the Maestro’s TX/RX baud rate works when its Serial mode is set to USB Dual Port: When the Maestro powers up, it sets the TX/RX baud rate to 9600. This default value is undocumented because we didn’t think it would be important. The TX/RX baud rate can be changed via USB using a terminal program. If the Maestro disconnects from USB while remaining powered, it will retain whatever baud rate it had before. Therefore if you power the Maestro up without ever connecting it to USB, its TX/RX lines will be at 9600 baud, so any byte sent using serial_send_byte will be sent out at 9600 baud.

If you want control over the baud rate used by serial_send_byte, you should set your serial mode to “UART, fixed baud rate” and select your desired baud rate.

We didn’t anticipate an application like yours where you want to send serial bytes both from a computer (through /dev/ttyACM1) and from Maestro scripts using serial_send_byte. So I’m curious, what you are you making?

If you want to be able to send bytes both from the computer, and from the script, and you don’t want to use 9600 baud here’s what you can do:

Set the Maestro to Serial Mode = UART, fixed baud rate, and select the desired baud rate. Store the following script on the Maestro:

sub send_byte
  serial_send_byte
  quit

To send serial bytes from your computer, use the command-line utility UscCmd:

UscCmd --sub 0,0xDA

Be sure to delay a little bit after calling usccmd to give the script time to finish executing. Note that sending bytes from usccmd this way will cause whatever script that was running to be aborted, but you can restart it later. I’m not sure if that’s a problem for you.

–David Grayson

Thanks for the quick and detailed reply - this clarifies everything!

I didn’t say that right: I’m using the Maestro to control various (short-lived) projects (built with fischertechnik). I originally bought the Maestro to access servos, motors, and sensors through USB from a small PC. But then I found the scripting support so powerful that I can often do without the PC, using the Maestro in stand-alone mode. It’s really a wonderful little device :slight_smile:

So I do use both serial_send_byte and /dev/ttyACM1 to talk to the Qik, but not in the same project.

Thanks again!