Serial Buses

In addition to the digital and analog inputs, the roboRIO also offers several methods of serial communication with peripheral devices.

Both the digital and analog inputs are highly limited in the amount of data that can be send over them. Serial buses allow users to make use of far more-robust and higher-bandwidth communications protocols with sensors that collect large amounts of data, such as inertial measurement units (IMUs) or 2D LIDAR sensors.

Types of supported serial buses

The roboRIO supports many basic types of serial communications:

Additionally, the roboRIO supports communications with peripheral devices over the CAN bus. However, as the FRC CAN protocol is quite idiosyncratic, relatively few peripheral sensors support it (though it is heavily used for motor controllers).

I2C

../../../_images/roborio-i2c.svg../../../_images/i2c-pinout.png

To communicate to peripheral devices over I2C, each pin should be wired to its corresponding pin on the device. I2C allows users to wire a “chain” of slave devices to a single port, so long as those devices have separate IDs set.

The I2C bus can also be used through the MXP expansion port. The I2C bus on the MXP is independent. For example, a device on the main bus can have the same ID as a device on the MXP bus.

SPI

../../../_images/roborio-spi.svg../../../_images/spi-pinout.png

To communicate to peripheral devices over SPI, each pin should be wired to its corresponding pin on the device. The SPI port supports communications to up to four devices (corresponding to the Chip Select (CS) 0-3 pins on the diagram above).

The SPI bus can also be used through the MXP expansion port. The MXP port provides independent clock, and input/output lines and an additional CS.

RS-232

../../../_images/roborio-rs-232.svg../../../_images/rs232-pinout.png

To communicate to peripheral devices over RS-232, each pin should be wired to its corresponding pin on the device.

The RS-232 bus can also be used through the MXP expansion port.

The RoboRIO RS-232 serial port uses RS-232 signaling levels (+/- 15v). The MXP serial port uses CMOS signaling levels (+/- 3.3v).

Note

By default, the onboard RS-232 port is utilized by the roboRIO’s serial console. In order to use it for an external device, the serial console must be disabled using the Imaging Tool or roboRIO Web Dashboard.

One of the USB ports on the roboRIO is a USB-B, or USB client port. This can be connected to devices, such as a Driver Station computer, with a standard USB cable.

USB Host

../../../_images/roborio-usb-host.svg

Two of the USB ports on the roboRIO is a USB-A, or USB host port. These can be connected to devices, such as cameras or sensors, with a standard USB cable.

MXP Expansion Port

../../../_images/roborio-mxp.svg../../../_images/mxp-pinout.png

Several of the serial buses are also available for use through the roboRIO’s MXP Expansion Port. This port allows users to make use of many additional digital and analog inputs, as well as the various serial buses.

Many peripheral devices attach directly to the MXP port for convenience, requiring no wiring on the part of the user.

CAN Bus

../../../_images/roborio-can.svg

Additionally, the roboRIO supports communications with peripheral devices over the CAN bus. However, as the FRC CAN protocol is quite idiosyncratic, relatively few peripheral sensors support it (though it is heavily used for motor controllers). One of the advantages of using the CAN bus protocol is that devices can be daisy-chained, as shown below. If power is removed from any device in the chain, data signals will still be able to reach all devices in the chain.

../../../_images/can-bus-talon-srx-chain.png

Several sensors primarily use the CAN bus. Some examples include:

More information about using devices connected to the CAN bus can be found in the article about using can devices.