5.6 Connectivity/Communication

Universal Synchronous/Asynchronous Serial Receiver and Transmitter (USART)

The PIC16F, PIC18F and PIC32CM MCUs provide highly flexible and robust USART peripherals. All USART variants (EUSART, UART, USART) support buffered communication, interrupt-driven operation, and operation in low-power modes, suitable for a variety of embedded communication needs. The following table provides a comparison of features of the PIC16F, PIC18F, and PIC32CM MCUs.

Table 5-20. PIC16F, PIC18F, and PIC32CM UART Features
FeaturePIC16F EUSARTPIC18F EUSART/UARTPIC32CM SERCOM-USART
IntegrationStandalone peripherals:

USART

EUSART (Enhanced USART)

Standalone peripherals:

USART

EUSART

UART with Protocol Support

Mode in SERCOM (Serial Communications) peripheral
Operation ModesFull-duplex

Half-duplex

Synchronous/asynchronous

Full-duplex

Half-duplex

Synchronous/asynchronous

Full-duplex

Half-duplex

Synchronous/asynchronous

Protocol/ Standard SupportVaries per device family:

RS-232, RS-485

LIN host/client

IrDA

Varies per device family:

RS-232, RS-485

LIN host/client

IrDA

DMX

DALI

Varies per device family:

IrDA®

LIN host/client

ISO 7816 (smart card)

RS-485

Buffer/FIFO Up to 8 bytes (device-dependent)Up to 16 bytes (device-dependent)16-byte transmit/receive FIFO
Baud Rate Generation (BRG)8-bit or 16-bit BRG16-bit BRG16-bit BRG, internal/external clock
Data Bits 8, 97, 8, 95, 6, 7, 8, 9
Stop Bits1 or 2 bits1, 1.5, or 2 bits1 or 2 bits
ParityThrough firmware using the 9th bitOdd, Even, or 9th bit Address DetectionOdd, even, none
Data OrderLSb firstLSb or MSb first

Selectable

LSb or MSb first

Selectable

Flow ControlN/ARequest-to-Send (RTS)

Clear-toSend (CTS)

RTS

CTS

DMA SupportN/ASupportedSupported
Error DetectionParity

Overrun

Frame error

Parity

Overrun

Frame error

Checksum

Collision

Parity

Buffer overflow

Frame error

Noise filtering

Collision detection

Sleep Mode OperationSupportedSupported
InterruptsTX/RXTX/RX

Errors

Multiple, including FIFO events
Pin MappingFlexibleFlexible
Baud Rate RangeUp to 1 Mbps (device-dependent)Up to 2 Mbps (device-dependent)Up to 6 Mbps or higher (device-dependent)
Auto-Baud DetectionSupportedSupportedSupported
Event System IntegrationN/AN/ASupported

Serial Peripheral Interface (SPI)

The PIC16F, PIC18F, and PIC32CM MCUs provide SPI peripherals that feature high-speed, full-duplex, synchronous data transfer between microcontrollers and other devices. Both SPIs support host and client modes, allowing communication with a wide range of external devices. The following table provides a comparison of features of the PIC16F, PIC18F and PIC32CM.

Table 5-21. PIC16F, PIC18F, and PIC32CM SPI Features
FeaturePIC16F MSSPPIC18F MSSP/SPIPIC32CM SERCOM-SPI
IntegrationMSSP (Host Synchronous Serial Port),

Stand-alone SPI

MSSP,

Stand-alone SPI

Mode in SERCOM peripheral
Data Buffering One-level TX buffer,

Two-level RX buffer

FIFOOne-level TX buffer,

Two-level RX buffer,

internal FIFO

Host/Client SupportSupportedSuportedSupported
Data Width8 bits (standard)

16 bits

8 bits (standard)

16 bits

8/16 bits (configurable)
Bit Rate/Clock SpeedUp to 10 MHzUp to 20 MHzUp to 24 MHz
SPI Modes Supported All four SPI modesAll four SPI modesAll four SPI modes
Data Order MSb firstLSb or MSb first LSb or MSb first
DMA SupportN/ASupportedSupported
Framed SPI/FSYNCHardware-controlled through Client Select (SS) pin Hardware-controlled through SS pinHardware-controlled FSYNC
0-bit Extension N/AN/ASupported
Wake-up from Idle SupportedSupportedSupported
Write Collision ProtectionSupportedSupportedSupported
InterruptsSupportedSupportedSupported
Pin Mapping FlexibleFlexibleFlexible
Advanced FeaturesEnhanced buffer, auto-CS, interrupt, 16-bit modeEnhanced buffer, auto-CS, interrupt, 16-bit mode, advanced error flags, DMADMA, Event System, sleepwalking, multi-protocol

Inter-Integrated Circuit (I2C)

The PIC16F/PIC18F MSSP/I2C and the PIC32CM Serial Communication (SERCOM) provide Philips I2C-compatible peripherals for flexible inter-device communication on a shared bus. Both peripherals support host and client modes, standard and fast I2C speeds (up to 1 MHz), multi-host arbitration, and bus error detection. PIC18F also has an Improved I2C (I3C) peripheral that is significantly faster and offers more advanced features, refer to the table, Other PIC16F/PIC18F Features and Peripherals). The following table provides a comparison of the I2C features of the PIC16F, PIC18F, and PIC32CM.

Table 5-22. PIC16F, PIC18F, and PIC32CM I2C Features
FeaturePIC16F MSSPPIC18F MSSP/I2CPIC32CM (All Families)
IntegrationMSSP (Host Synchronous Serial Port),

Stand-alone I²C

MSSP,

Stand-alone I²C

Mode in SERCOM peripheral
Host/Client ModesSupportedSupportedSupported
Addressing7-bit, 10-bit

General call

Address masking

7-bit, 10-bit

General call

Address masking

7-bit, 10-bit

General call

Address masking

Dual address match

Data BufferingUp to 8 bytes FIFOUp to 16 bytes FIFO16-byte internal FIFO
DMA Support N/ASupportedSupported
Bus Speeds Supported100 kHz, 400 kHz100 kHz, 400 kHz, 1 MHz 100 kHz, 400 kHz, 1 MHz, 3.4 MHz
SMBus/PMBus™ SupportSMBus and PMBus compatibleSMBus and PMBus compatibleSMBus and PMBus compatible
Multi-Host ArbitrationSupportedSupportedSupported
Wake-up from SleepSupported (on address match)Supported (on address match and byte transfer)Supported (on address match)
Input FilteringSelectable SDA hold times to assist with bus capacitanceDedicated pad control with slew rate and threshold selectionsFiltered inputs, slew-rate limited outputs
4-Wire OperationN/AN/AYes (for advanced protocols)
Data Extension N/AN/A32-bit data extension
FIFO1-byte FIFO2-byte FIFO16-byte FIFO
Max Clock SpeedUp to 400 kHz (Fast mode)Up to 1 MHz (Fast mode Plus)

Up to 12.5 MHz (High-Speed I3C)

Up to 3.4 MHz (High-Speed mode)
Event System IntegrationN/AN/ASupported

Universal Serial Bus (USB)

Some PIC16F, PIC18F, and PIC32CM MCUs offer integrated USB peripherals that comply with USB 2.0 Full-Speed (12 Mbps) device standards, supporting all four endpoint transfer types, endpoint buffering, and low-power operation with suspend/resume features, with minimal CPU intervention and interrupt load. The following table provides a comparison of features of the PIC16F, PIC18F and PIC32CM.

Table 5-23. PIC16F, PIC18F, and PIC32CM USB Features
FeaturePIC16F USBPIC18F USBPIC32CM USB
USB SupportUSB 2.0 Full-Speed DeviceUSB 2.0 Full-Speed DeviceUSB 2.1 (Full-Speed 12 Mbps, Low-Speed

1.5 Mbps) Device, Host, OTG

Host/Device Modes Device modeDevice modeHost and Device mode
Host Mode Features Host-detectionHost-detectionEight physical pipes

Unlimited virtual pipes

Feedback endpoint

SOF clock output

Endpoint Addresses8 bidirectional endpoints16 bidirectional endpoints8 (16 endpoints: 8 IN, 8 OUT)
Endpoint Transfer TypesControl

Interrupt

Bulk

Isochronous

Control

Interrupt

Bulk

Isochronous

Control

Interrupt

Bulk

Isochronous

Max Payload per EndpointUp to 1023Up to 1023No endpoint size limitation (typically up to 1023 bytes)
Endpoint BufferingDual Access RAMDual Access RAMInternal SRAM, fully configurable
Multi-Packet TransferSupported (through software)Supported (through software)Supported
Double Buffering Dual bank (ping-pong) Dual bank (ping-pong)Dual bank (ping-pong)
Power ManagementSuspend mode

Wake-up from sleep

Suspend mode

Wake-up from sleep

Suspend/Resume

Wake-up from sleep

Link Power Management (LPM-L1) support

On-Chip TransceiverSupportedSupportedSupported
DMA SupportN/ASupportedBuilt-in for endpoint data and configuration
Crystal-less OperationSupportedSupportedSupported
Debug SupportSupportedSupportedN/A
Buffer SizeUp to 64 bytesUp to 512 bytes Up to 1 KB+
VBUS/ID Pin SupportN/ASupportedSupported
USB Classes SupportedCDC, HIDCDC, HID, MSCCDC, HID, MSC, Audio

Controller Area Network (CAN)

Some of the PIC18F and PIC32CM MCUs offer integrated CAN controllers, enabling connection to CAN networks for automotive and industrial applications. These CAN peripherals support standard CAN 2.0 A/B protocols, provide message filtering, and include error handling and interrupt capabilities. They are designed to offload CAN protocol management from the CPU, improving real-time communication performance. Both variants require an external CAN transceiver for physical layer connectivity.

The following table provides a comparison of the CAN features of the PIC18F and PIC32CM.

Table 5-24. PIC18F and PIC32CM CAN Features
FeaturePIC18F CANPIC32CM CAN
CAN PeripheralsCAN, ECAN (Enhanced CAN)CAN
Protocol SupportCAN 2.0A/B

CAN-FD (ISO 11898-1:2015)

CAN 2.0A/B

CAN-FD (ISO 11898-1:2015)

Max Data Rate 1 Mbps (CAN 2.0)

Up to 8 Mbps (CAN-FD)

1 Mbps (CAN 2.0)

10 Mbps (CAN-FD)

Message Objects/Buffers Up to 32 buffers/FIFO Up to 64 RX and 32 TX dedicated buffers Two RX FIFOs
Data Buffer SizeUp to 64 bytes per CAN-FD frameUp to 64 bytes per CAN-FD frame
Acceptance FilteringUp to 16 full filters and 3-4 masks (ECAN, CAN FD)Up to 128 configurable filter elements J1939 filter
Time StampingLinks to internal Timer1/3/5 through CCP modulesCiA 603 hardware timestamping External Timestamping Unit (TSU)
Loopback/Test Mode Supported for self-test operationsProgrammable loopback test mode
Error Handling Advanced error managementCAN error logging

Advanced error signaling

AUTOSAR/J1939 Optimization SupportedSupported
Number of CAN Channels Up to oneUp to two
Power-Down/Debug SupportLow-power Sleep mode

Bus activity wake-up with filter

Power-down Debug on CAN support
Host Memory AccessBuffers mapped into SFR memory spaceUses system RAM through AHB (flexible allocation)
Wake Up from SleepSupported (CAN bus activity)Supported (CAN bus activity, event system)
DMA SupportSupportedSupported
Event System IntegrationN/ASupported (event triggers, sleepwalking)