Frequently Asked Questions
How does one choose which communication interface to use for a certain application?
Selecting an Interface
The navX-MXP provides several methods for communicating with robotics control applications:Streaming vs. Register-based Communication
The navX-MXP interfaces fall into two types: Streaming and Register-based.Streaming: data is sent at regular intervals by the navX-MXP, and the host is notified when new data arrives. To support the low bitrate of the TTL UART interface, the streaming data is sent in two different formats: Processed Data and Raw data. Streaming is used over the TTL UART and USB interfaces. More details on the communication detail are available in the Serial Protocol Definition.
Register-based: communication is initiated by the host whenever new data is desired, and the host can request any data required. Register-based communication is used over the I2C and SPI interfaces. More details on the communication detail are available in the Register Protocol Definition.
Comparing the navX-MXP Communication Interfaces
Interface Type | Speed | Latency | Type | Cable distance | Max Update Rate | Supports MXP IO? |
TTL UART | 57600 bps | 11ms | Streaming | 15 meters | 66 | Yes |
USB | 12 mbps | Streaming | 6 meters | 200 | No | |
I2C | 400 kbps | ~10ms | Register-based | 1 meter | 200 | Yes |
SPI | 2 mbps | Register-based | 200 | Yes |
Recommendations
Based upon the above, the following recommendations are provided for selecting the best navX-MXP communications interface:β If mounting the navX-MXP directly on the RoboRIO, the SPI interface is preferred for itβs high speed and low latency.
β If mounting the navX-MXP separately from the RoboRIO using an extension cable and if MXP IO support is desired, run SPI at a lower speed, or use the TTL UART interface. If using LabVIEW, the I2C interface is also a reasonable option. Please also note that the TTL UART interface cannot support update rates greater than 80Hz.
β If mounting the navX-MXP separately from the RoboRIO, and MXP IO support is not desired and only Processed or Raw Data (not both) is needed, USB is recommended. This configuration is useful when using the navX-MXP magnetometer data, since it makes it possible to mount the navX-MXP far away from motors. This configuration is also useful when accessing navX-MXP data from a separate processor, such as a PC or a separate video processor.
Last Updated 7 years ago