CAN

Module MCP2515

The MCP2515 is a stand-alone CAN (Controller Area Network) controller developed by Microchip Technology. It is widely used in automotive and industrial applications for communication between microcontrollers or other devices on a CAN bus.

Initialize

Configuration mode

Normal mode

LoopBack mode

Transmission

Reception

Interrupt

Can interrupt when

  1. Transmit request completed

  2. Frame is received in RX FIFO0

  3. Frame is received in RX FIFO1

  4. During CAN status change or Error

Note

Four interrupt vectors are dedicated to bxcan

Filter Bank

Mask mode

../_images/maskmodediagram.png

Ex: Accept frame only if first 3 msbs of the standard identifier are 1s

../_images/maskmode.png

Ex: Accept only Request frames

../_images/maskmodeRequestframe.png

Ex: Accept only Extended id frames

../_images/maskmodeExtendID.png

Ex: Accept all frames

../_images/acceptallframe.png

List/ID mode

Ex: Accept fgrame only if standard identifier value exactly = 0x65D or 0x651

../_images/listmode.png

Note

If filter is disable, there will be no message in FIFO.