5 Protocol Comparison
MPLAB Data Visualizer supports three protocols for variable monitoring: Variable Streamer, DVRT, and X2Cscope. This section helps you choose the right protocol for your application.
Variable Streamer
Variable Streamer is the most lightweight protocol option. Variables to stream are predefined at compile time, and the user sends streaming data manually from a location in the application. Data is continuously streamed from the target to the PC as it is sampled. The protocol only supports streaming (one-way communication from target to PC).
The protocol uses UART for communication and has minimal firmware overhead.
- Simple data logging with minimal firmware overhead
- Applications where the streamed variables are fixed
- Projects already using MCC with Variable Streamer driver
DVRT
DVRT provides flexible runtime configuration. Variables can be configured at runtime without code changes - the set of streamed variables and timing parameters can be dynamically updated. Data is continuously streamed to the PC as it is sampled. In addition to streaming, DVRT allows reading and writing individual variables on demand (bi-directional communication).
The protocol has low overhead and uses UART for communication and a timer interrupt for sampling.
- General debugging requiring flexible variable selection
- Applications needing continuous real-time streaming
- Quick iteration where streamed variables change frequently
X2Cscope
X2Cscope is a runtime debugging tool that uses the LNet protocol. The protocol has low overhead and uses UART for communication and a timer interrupt for sampling.
X2Cscope supports watch and scope functionality. With the scope function, X2Cscope first samples data into an internal buffer on the target MCU, then transfers the complete buffer to the PC. This approach allows capturing high-frequency signals without requiring high-bandwidth continuous communication. The set of monitored variables and timing parameters can be dynamically updated at runtime. Trigger detection is performed on the target MCU itself and controls whether data is actually captured into the buffer on the target.
The watch function reads/writes variables on demand. The MCU only responds when requested, there is no streaming. There is not any need for a buffer on the MCU to do this.
- Motor control applications requiring parameter tuning
- Capturing fast signals with precise trigger timing
- Applications where continuous streaming bandwidth is limited
Quick Reference
| Variable Streamer | SVRT | X2Cscope | |
|---|---|---|---|
| Overhead | Minimal | Low | Low |
| Complexity | Minimal | Low | Low |
| Streaming configuration | Fixed (compile time) | Flexible (runtime) | Flexible (runtime) |
| Adjustable data rate | No | Yes | Yes (sample factor) |
| Can write to the target | No | Yes | Yes |
| Data capture method | Streaming | Streaming | Buffered |
| Trigger support | PC-side | PC-side | Target-side |
| MCC Driver support | Yes | Yes | Yes |
