Main Content

CAN

R2026b
Communication using CAN protocol

Controller Area Network (CAN) is a robust communication protocol that enables communication between multiple devices. Use CAN to efficiently design and implement reliable CAN-based communication systems.

Blocks

CAN Transmit blockCAN Transmit Transmit message to CAN network
CAN Receive blockCAN Receive Receive message from CAN network
Arduino On-board CAN Receive block iconOn-board CAN ReceiveReceive messages using on-board Arduino CAN controller (Since R2024b)
Arduino On-board CAN Transmit block iconOn-board CAN TransmitTransmit messages to CAN network using on-board Arduino CAN controller (Since R2024b)

Model Settings

expand all

CAN Bus Speed (kBit/s)Speed at which messages are transmitted
Oscillator Frequency (MHz)Oscillator frequency of CAN network
Interrupt PinSPI pin on the hardware to which the CAN shield is connected
Allow All MessagesOption to allow all IDs to pass filter
Buffer 0 ID TypeBuffer 0 id type
Buffer 0 Acceptance Mask (RXMO)Value for buffer 0 acceptance mask (RXMO)
Buffer 0 Acceptance Filter (RXF0)Value for buffer 0 acceptance filter (RXF0)
Buffer 0 Acceptance Filter (RXF1)Value for buffer 0 acceptance filter (RXF1)
CAN Bus Speed (kBits/s)CAN data transmission speed in kilo bits per second (Since R2024b)
CAN PinsCAN pins for on-board Arduino Teensy CAN1 controller (Since R2024b)
Filter configurationAcceptance filter filtering criteria (Since R2024b)
Number of mailboxNumber of CAN mailboxes (Since R2024b)
Mailbox typeType of CAN mailbox to either receive or transmit data (Since R2024b)
ID typeCAN message ID type (Since R2024b)
IDCAN receiver filter value (Since R2024b)
ID RangeMatrix of CAN receiver filter identifiers (Since R2024b)
MaskCAN receiver mask value (Since R2024b)
Enhance filterEnhanced filtering option (Since R2024b)
CAN interface typeType of CAN interface used for XCP on CAN external mode communication (Since R2026b)
CAN moduleOn-board CAN controller module for XCP on CAN external mode communication (Since R2026b)
CAN Bus Speed (kBit/s)Speed at which messages are transmitted
CAN VendorCAN hardware vendor for XCP on CAN external mode communication (Since R2026b)
CAN DeviceCAN hardware device for XCP on CAN external mode communication (Since R2026b)
CAN ChannelCAN hardware channel for XCP on CAN external mode communication (Since R2026b)
Extended CAN IDUse extended 29-bit CAN identifiers for XCP external mode communication (Since R2026b)
CAN ID commandCAN identifier for XCP command messages from host to target (Since R2026b)
CAN ID responseCAN identifier for XCP response messages from target to host (Since R2026b)

XCP on CAN with Arduino

Set Up, Deploy, and Calibrate Arduino Application Using XCP on CAN

Set up XCP on CAN communication, deploy a Simulink® application to Arduino®, and perform real-time monitoring and calibration using Simulink or third-party calibration tools.

Featured Examples