Communication blocks provide serial interfaces for data exchange, sensor connectivity, and network integration. The MPLAB Blockset offers comprehensive support for UART (asynchronous serial), SPI (high-speed synchronous), I2C (multi-master bus), and CAN (automotive/industrial networking) protocols across all Microchip device families.
| Protocol | Block(s) | Speed | Wiring | Best For |
|---|---|---|---|---|
| UART | Config + Tx + Rx | Up to 10 Mbps | 2-wire (TX/RX) | Point-to-point, GPS, Bluetooth, debug console |
| SPI | SPI Master/Slave | Up to 50 Mbps | 4-wire (MOSI/MISO/SCK/CS) | High-speed sensors, displays, SD cards |
| I2C | I2C Master | Up to 1 Mbps | 2-wire (SDA/SCL) | Multi-device bus, EEPROMs, sensors, RTCs |
| CAN | Config + Tx + Rx | Up to 1 Mbps | 2-wire (CAN_H/CAN_L) | Automotive, industrial networks, robust environments |
| Application | Recommended Protocol | Block Choice |
|---|---|---|
| GPS Module | UART | UART_Config + UART_Rx |
| Bluetooth Module | UART | UART_Config + UART_Tx + UART_Rx |
| SD Card Interface | SPI | SPI Master |
| IMU Sensor | SPI or I2C | SPI (fast) or I2C (multi-device) |
| OLED Display | SPI or I2C | SPI (high-speed) or I2C (minimal wiring) |
| EEPROM | I2C | I2C Master |
| Real-Time Clock | I2C | I2C Master |
| Motor Control Network | CAN | CAN_Config + CAN_Tx + CAN_Rx |
| Automotive ECU | CAN | CAN_Config + CAN_Tx + CAN_Rx |
| MATLAB Data Logging | UART | UART_TxMatlab + picgui |
| Device Family | UART | SPI | I2C | CAN |
|---|---|---|---|---|
| dsPIC30F | ✅ Up to 2 | ✅ Up to 2 | ✅ Up to 2 | ✅ Up to 2 |
| dsPIC33F | ✅ Up to 2 | ✅ Up to 2 | ✅ Up to 2 | ✅ Up to 2 |
| dsPIC33E | ✅ Up to 4 | ✅ Up to 3 | ✅ Up to 3 | ✅ Up to 2 |
| dsPIC33C | ✅ Up to 4 | ✅ Up to 4 | ✅ Up to 4 | ✅ Up to 2 |
| dsPIC33A | ✅ Up to 4 | ✅ Up to 4 | ✅ Up to 4 | ✅ Up to 2 |
| PIC24 | ✅ Up to 2 | ✅ Up to 2 | ✅ Up to 2 | ❌ |
| PIC32MK | ✅ Up to 6 | ✅ Up to 6 | ✅ Up to 5 | ✅ Up to 4 |
| PIC32MZ | ✅ Up to 6 | ✅ Up to 6 | ✅ Up to 5 | ✅ Up to 4 |
| SAM E5x/D5x | ✅ Up to 6 | ✅ Up to 8 | ✅ Up to 8 | ✅ CAN FD |
| SAM E7x/S7x/V7x | ✅ Up to 3 | ✅ Up to 3 | ✅ Up to 3 | ✅ CAN FD (MCAN) |
Note: Actual peripheral count is device-dependent. Consult datasheet for exact numbers.
| Communication Block | dsPIC30F | dsPIC33F | dsPIC33E | dsPIC33C | dsPIC33A | PIC24 | PIC32 | SAM |
|---|---|---|---|---|---|---|---|---|
| UART_Config | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| UART_Tx | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| UART_Rx | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| UART_TxMatlab | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| SPI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| I2C_Master | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| CAN_Config | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
| CAN_Tx | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
| CAN_Rx | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Legend: ✅ Full Support | ❌ Not Available
Notes:
| Protocol | Max Speed | Wires | Devices per Bus | Complexity | Use Case Priority |
|---|---|---|---|---|---|
| UART | 10 Mbps | 2 | 2 (point-to-point) | 🟢 Straightforward | 1. Debug console 2. GPS/Bluetooth 3. Sensors |
| SPI | 50 Mbps | 4 | Multiple (star) | 🟡 Moderate | 1. High-speed data 2. Displays 3. SD cards |
| I2C | 1 Mbps | 2 | 127 (bus) | 🟡 Moderate | 1. Multi-sensor 2. EEPROM/RTC 3. Low-speed control |
| CAN | 1 Mbps | 2 | 127 (bus) | 🔴 Advanced | 1. Automotive 2. Industrial 3. Noisy environments |
Problem: No data received
Problem: Corrupted data
Problem: No communication
Problem: Data corruption
Problem: No acknowledgment from slave
Problem: Bus hangs or clock stretching
Problem: No messages received
Problem: Bus errors
Related Block Categories:
Application Notes:
Example Projects:
💡 Quick Selection Guide:
Universal Asynchronous Receiver/Transmitter blocks for serial communication with configurable baud rates, hardware flow control, and interrupt-driven or DMA data transfer.
Read more →Controller Area Network blocks for robust automotive and industrial communication with configurable filters, masks, and multi-channel message handling.
Read more →BUS I2C MASTER Block The BUS I2C Master block configures and executes I2C (Inter-Integrated Circuit) communication sequences as a bus master. This …
Read more →BUS SPI Block The BUS SPI block configures and executes SPI (Serial Peripheral Interface) communication sequences as either Master or Slave. This …
Read more →