Understanding the Serial Protocol

I have a Tic T834 that I am communicating with using a USB to TTL converter. I am running both the control center and Pololu Serial Transmitter v1.3. My stepper motor moves fine when I use the Set Target functionality from Control Center.

I am not understanding what commands I should send from Serial Transmitter to accomplish the same thing. I assume a 5-byte command, 0xE0 followed by 4 data bytes. Maybe I’m not understanding the 7 bit data concept?

Could someone please show me the commands they would send to set the position from Serial Transmitter?

Thank you.

This C Source code helped me. Seems as if the issue was I needed the 6th byte (presumably due to the 7 bit transmit).

command[0] = 0xE0;
command[1] = ((value >> 7) & 1) |
((value >> 14) & 2) |
((value >> 21) & 4) |
((value >> 28) & 8);
command[2] = value >> 0 & 0x7F;
command[3] = value >> 8 & 0x7F;
command[4] = value >> 16 & 0x7F;
command[5] = value >> 24 & 0x7F;

Now, my question is how to do a read of the device to get the current position. Shouldn’t I just send a single byte of 0xA1, and data should be transmitted back?

Hello.

In case you have not seen it, I suggest carefully reviewing the “Serial command encoding” section of the Tic user’s guide.

As described under the “Block read” header, you need to send at least three bytes to get data back from the Tic: command, offset, and length. You can see an example implementations of this in some of the “Writing PC software to control the Tic” sections (it sounds like you might have already found the Example serial code for Windows in C).

- Patrick

Awesome Patrick, thanks for the reply. Everything is working as expected now. :slight_smile: