# Arduino Portenta H7 Lite with mcp2515

**URL:** <https://forum.arduino.cc/t/arduino-portenta-h7-lite-with-mcp2515/1102031>\
**Category:** Portenta H7\
**Created:** [March 14, 2023, 10:32pm UTC](https://forum.arduino.cc/t/arduino-portenta-h7-lite-with-mcp2515/1102031 "2023-03-14T22:32:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolasbdt](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicolasbdt](https://forum.arduino.cc/u/nicolasbdt)\
**Post date:** [March 14, 2023, 10:32pm UTC](https://forum.arduino.cc/t/arduino-portenta-h7-lite-with-mcp2515/1102031/1 "2023-03-14T22:32:11Z")

</div>

Hi,

I'm using the autowp-mcp2515 and Arduino\_PortentaBreakout library for a CAN BUS interface using the Arduino Portenta H7 Lite.

```arduino
#include <SPI.h>
#include <mcp2515.h>
#include <Arduino_PortentaBreakout.h>

struct can_frame canMsg;
MCP2515 mcp2515(SPI1_CS);

void setup() {
  Serial.begin(115200);
  
  mcp2515.reset();
  mcp2515.setBitrate(CAN_125KBPS);
  mcp2515.setNormalMode();
  
  Serial.println("------- CAN Read ----------");
  Serial.println("ID DLC DATA");
}

void loop() {
  if (mcp2515.readMessage(&canMsg) == MCP2515::ERROR_OK) {
    Serial.print(canMsg.can_id, HEX); // print ID
    Serial.print(" "); 
    Serial.print(canMsg.can_dlc, HEX); // print DLC
    Serial.print(" ");
    
    for (int i = 0; i<canMsg.can_dlc; i++) { // print the data
      Serial.print(canMsg.data[i],HEX);
      Serial.print(" ");
    }

    Serial.println();      
  }
}

```

When I upload this sketch, the Arduino Portenta H7 Lite immediatly goes into SOS mode (4X blink red LED short, 4X blink red LED long) when going through line 5&6 of the sketch (creating the mcp2515 object).

What could be the problem here?

---

<div class="post-metadata">

**Author:** ![nicolasbdt](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nicolasbdt](https://forum.arduino.cc/u/nicolasbdt)\
**Post date:** [March 15, 2023, 12:06am UTC](https://forum.arduino.cc/t/arduino-portenta-h7-lite-with-mcp2515/1102031/2 "2023-03-15T00:06:29Z")

</div>

I fixed this issue thanks to this topic:

> <https://github.com/autowp/arduino-mcp2515/issues/15>
>
> I'm trying to use your library with Arduino Due and it won\`t work.
> I spent some… time to make it working and I found solution.
> Two line were commented in the file mcp2515.cpp
> 
> MCP2515::MCP2515(const uint8\_t \_CS)
> {
> //SPI.begin(); //\<==Commented
> SPICS = \_CS;
> pinMode(SPICS, OUTPUT);
> //endSPI(); //\<==Commented
> }
> After this change Due successfully works with your samples and Can Hacker works too.
> Are you sure SPI.begin() is needed here? All your examples also contains SPI.begin() in Setup.

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [August 29, 2026, 5:00am UTC](https://forum.arduino.cc/t/arduino-portenta-h7-lite-with-mcp2515/1102031/3 "2026-08-29T05:00:01Z")

</div>

Split this topic on August 29, 2026, 5:00am UTC

A post was split to a new topic: [Connecting MCP2515 to Portenta H7](https://forum.arduino.cc/t/connecting-mcp2515-to-portenta-h7/1457561)
