Can't connect TRex to RS-232 port

I try to connect TRex to computer by RS-232 port.
And I get error: can’t detect TRex device on port COM1. (I use COM1 port).

I connected COM port with three wires as on picture

Only those three wires are required?. And of course a power supply connected to VIN / GND
But I do not know how to set jumpers.

If it’s possible, I would like to see a real picture of the connected circuit.

Hello, Pele.

I am sorry you are having trouble connecting to your TReX. You should only need those three connections and power across VIN and GND. Could you make sure you are in serial mode by removing all jumpers? Can you tell me what serial settings you use when you connect to your TReX using the TReX Configurator? What baud rate are you using? What do have you selected for “Error Checking”? Also, does your input supply share a common ground with your computer? Have you verified that the cable you are using is working? If it is working, can you post a picture of your connections?


[quote=“JonathanKosh”] Also, does your input supply share a common ground with your computer?

I’m not sure, what does mean? Do I need to do some extra connection between ground in computer and ground in circuit?
A black wire from COM port is not enough?

I’m sorry; that question could have been more clear. I was checking to see if you had all of your grounds connected; it seems like you do. We can continue troubleshooting if you answer my other questions.


finally I’ve succeeded to connect (I restored factory settings).
But now I have a slightly different problem.

  1. I’m trying to set different stopping times of motors, but they always stop immediately. I would like to stop them smoothly.
  2. I turned on the parabolic option. Is it possible to adjust the slope of the parabolic curve?

I am glad you can connect to your TReX. But now I am not entirely sure how you are controlling it. From your earlier post, it sounded like you were using it for serial control, but your question about the parabolic scaling makes it sound like you are using it with RC or analog control. How do you plan on interfacing with it?

The TReX does not offer deceleration limiting. If you are using the serial control interface, you will have to handle the deceleration yourself by sending decreasing speed commands over time. If you are using the TReX in RC or analog input mode, it should automatically set the motors to coast when those inputs are in the deadband, which is the smoothest it’s going to be able to stop your motors. You might check to make sure your TReX is still configured to respond in that way. (You can find the values for those settings inside the Deadband Behavior box, which is under the RC/Analog Params tab.)

Scaling motor speed parabolically is a feature that is used only for RC or analog control, and there is no way to adjust it.


I control my TReX by analog control to change speed or directions of motors, but the serial connection is needed to set parameters, wright?

Do I need to remove a jumper to set some parameter by serial connection and then set the jumper to analog mode to test new parameters every time?

Yes, to set certain parameters on the TReX, you will need to use its serial interface. Yes, you will need to remove the Mode-Select jumper to put the TReX in serial mode each time you configure it. (This is mentioned inside the Jumper Settings section of the TReX user’s guide.) Please note that the control interface is determined by the location of the mode jumper when the TReX is first powered up.


But, I want to use a microcontroller to configure my TReX.
Is in this case I have to remove and assume a jumper every time ?
Is a simplest way to do it?

Generally speaking, if you are going to have a microcontroller constantly connected to your TReX, you should probably be using the TReX in serial mode and controlling it serially from the microcontroller. If you still want to be able to control the TReX using a different interface, like RC or analog, you could keep the controller in serial mode, use the serial command to read the remapped channel values (0x87), and then issue a set motor command based on what you read. This would simulate RC or analog control while still leaving your microcontroller in charge.

Also, in typical applications, you should not need to reconfigure the settings very often, so occasionally switching the jumpers should not be much of a burden. Are you doing something that requires frequent settings changes?


I’m not quite understand.
Do I need to connect my analog joystick directly to the microcontroller?
and then what?

If you plan to control your TReX with an analog joystick, what do you need a microcontroller for?


A microcontroller is required to change settings (linear or logarithmic work, block one of channels, set reverse direction etc.)
I don’t want to remove cover of my control panel and plug TReX to computer to set new settings every time.

If you do not need to change settings very often, you could just connect your joystick to the analog input on the TReX and switch the jumper (and reset the board) every time you want to change them. If you would rather always use the TReX in serial mode and use your microcontroller to interpret the analog signals read by the TReX and send corresponding motor commands, like Jon mentioned earlier, you would still connect the joystick to the analog input on the TReX. In this case you would not ever need to change the jumper.


I think I do not understand. TReX must work in analog mode to operate the joystick, but changing settings is requires a serial mode, right?

In order to change the settings on the TReX it must be in serial mode. However, when the TReX is in serial mode it will still process the signal on its analog input and generate a target speed and direction based off of that input. It will not directly use those targets to move the motors, but you can use the “get remapped channel input values” serial command (0x87) to read the target speed and direction and then send set motor commands with the same target speed and direction to mimic the TReX’s analog control mode. More details on these commands can be found in the Serial Command List and Documentation section of the TReX user’s guide.


I read “0x87: get remapped channel input values” text and still do not understand.
Is it possible to show me a concrete example of what I have to do?

You can think of the 0x87 command as reading the TReX’s analog input values and interpreting them as motor speeds and directions that you can use with the serial set motor commands. Here is an example of using the 0x87 command:

command: 0x87, 0x3
response: 0xFF, 0x7F

During default operation, the two received bytes correspond to motor 1 direction and speed and motor 2 direction and speed, respectively. As it says in the TReX command document Claire linked to earlier, bits 6:0 of the remapped value indicate its magnitude (0 – 127) and bit 7 indicates its direction. So, 0xFF interprets as full speed in one direction with motor 1 and 0x7F represents full speed in the other direction with motor 2. You could then use this information to send appropriate serial commands for setting motor speed.