Serial Port Information

In the general RVR forum I asked some questions about the serial port. Here’s some more…

Repeat: what is the voltage on the serial port? The TX reads 3.3v. Is the RX limited to 3.3v or is 5v safe?

What is the speed of the port?

Can someone provide some basics on the protocol? Just enough to see if I have communications working, not the full API. Willing to help debug the API. Lots of experience with embedded systems.

Probably will start with desktop USB to serial port converter for testing and then switch to an Up Board which is a Linux based SBC. Will be using C++. Can port the Arduino libraries to more general use when they are available. That would make using C++ on the RPi possible.

1 Like

Greetings rmerriam! Thanks for your great questions! The voltage on the serial port is limited to 3.3V, and is not safe for 5V. We highly recommend you use a voltage level translator such as this one if you need to use it at 5V.

For the UART protocol, we have a standard 115200/8-N-1.

Also, be mindful that the quickstart guide that was printed has a typo with the UART connection lines.

For the protocol, I would encourage you to take a look at our documentation which should be live soon, and start by sending an LED command.

Lastly, in order for everything to work properly, make sure to connect the robot to the EDU app, and get the latest firmware on it!

2 Likes

For others interested I’ve determined the hex bytes control “power on” and “sleep” modes. The RVR responds with the strings shown:

Power: 8d3e1101130d008fd8 Response: 8d28011311ffb3d8
Sleep: 8D3E11011301009BD8 Response: 8d2801131affaad8

I sent this using CuteCom with input set to ‘hex’ mode. You select the mode with the dropdown next to the Input: box. Select Hex output below the output area to see the hex bytes.

The checksum is additive sum of all the characters after the leading 8D which is then inverted. The last D8 is appended after the sum.

The first layer of the protocol is thus:

8D <message bytes > <checksum> D8

Now to send this using C++. I already used C++ to generate the byte stream. Oh, I worked with these power commands because they are fixed input strings so simpler than trying to do LED or drive strings.

Sphero Py code is at: https://github.com/sphero-inc/sphero-sdk-microbit-python/blob/master/sphero.py

2 Likes

Thanks rmerriam – presumably the checksum is a byte / uint8_t , correct? Could conceivably be larger, but then I’d expect that we’d see leading 00s in e.g. a uint16_t checksum in the examples you posted.

1 Like

Yes, the checksum is a single byte. Just posted more info in the Advanced / Arduino section.

1 Like