5.6.5 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. Table 5-25 provides a comparison of features between PIC18F and PIC32CM.
| Feature | PIC18F CAN | PIC32CM CAN |
|---|---|---|
| CAN Peripherals | CAN, ECAN (Enhanced CAN) | CAN |
| Protocol Support | CAN 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 Size | Up to 64 bytes per CAN-FD frame | Up to 64 bytes per CAN-FD frame |
| Acceptance Filtering | Up to 16 full filters and three to four masks (ECAN, CAN FD) | Up to 128 configurable filter elements J1939 filter |
| Time Stamping | Links to internal Timer1/3/5 through CCP modules | CiA® 603 hardware timestamping External Timestamping Unit (TSU) |
| Loopback/Test Mode | Supported for self-test operations | Programmable loopback test mode |
| Error Handling | Advanced error management |
CAN error logging Advanced error signaling |
| AUTOSAR/J1939 Optimization | Supported | Supported |
| Number of CAN Channels | Up to one | Up to two |
| Power-Down/Debug Support |
Low-power Sleep mode Bus activity wake-up with filter | Power-down Debug on CAN support |
| Host Memory Access | Buffers mapped into SFR memory space | Uses system RAM through AHB (flexible allocation) |
| Wake Up from Sleep | Supported (CAN bus activity) | Supported (CAN bus activity, event system) |
| DMA Support | Supported | Supported |
| Event System Integration | N/A | Supported (event triggers, sleepwalking) |
