5.6.2 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. These SPIs support Host and Client modes, allowing communication with a wide range of external devices. Table 5-22 provides a comparison of features between PIC16F, PIC18F and PIC32CM.
| Feature | PIC16F MSSP | PIC18F MSSP/SPI | PIC32CM SERCOM-SPI |
|---|---|---|---|
| Integration |
Host Synchronous Serial Port (MSSP) Stand-alone SPI |
MSSP Stand-alone SPI | Mode in SERCOM peripheral |
| Data Buffering |
One-level TX buffer Two-level RX buffer | FIFO |
One-level TX buffer Two-level RX buffer internal FIFO |
| Host/Client Support | Supported | Supported | Supported |
| Data Width | Eight bits (standard) 16 bits | Eight bits (standard) 16 bits | 8/16 bits (configurable) |
| Bit Rate/Clock Speed | Up to 10 MHz | Up to 20 MHz | Up to 24 MHz |
| SPI Modes Supported | All four SPI modes | All four SPI modes | All four SPI modes |
| Data Order | MSb first | LSb or MSb first | LSb or MSb first |
| DMA Support | N/A | Supported | Supported |
| Framed SPI/FSYNC | Hardware-controlled through Client Select (SS) pin | Hardware-controlled through the SS pin | Hardware-controlled FSYNC |
| 0-bit Extension | N/A | N/A | Supported |
| Wake-up from Idle | Supported | Supported | Supported |
| Write Collision Protection | Supported | Supported | Supported |
| Interrupts | Supported | Supported | Supported |
| Pin Mapping | Flexible | Flexible | Flexible |
| Advanced Features |
Enhanced buffer Auto-CS Interrupt 16-bit mode |
Enhanced buffer Auto-CS Interrupt 16-bit mode Advanced error flags DMA |
DMA Event System Sleepwalking Multi-protocol |
