J
CANpull
LIVE

Hardware Pinout Reference

M5Stack ↔ MCP2515 CAN Bus Module — SPI wiring for Jeep Grand Cherokee OBD-II

3.3 V Logic

M5StickC S3 requires different pin assignments

The ESP32-S3 chip does not have GPIO 36 or GPIO 37, and GPIO 0 is a strapping pin — all three were used on the Plus 2 firmware. Use the pin mappings below and swap #include <M5StickCPlus2.h> for #include <M5Unified.h> before flashing.

M5StickC S3

ESP32-S3FN8 · 3.3 V GPIO

MCU

ESP32-S3FN8

Flash

8 MB

GPIO Voltage

3.3 V

SPI Bus

SPI2 / SPI3

WiFi

802.11 b/g/n

USB

Type-C (native USB)

MCP2515 CAN Bus Module

SPI CAN Controller · TJA1050 Transceiver

Interface

SPI

CAN Spec

2.0A / 2.0B

Max Speed

1 Mbps

Crystal

8 MHz

Supply

3.3 V / 5 V

Transceiver

TJA1050

Arduino IDE Setup for M5StickC S3

1

Install M5Stack board package

In Arduino IDE go to File → Preferences and add this URL to "Additional boards manager URLs":

https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
2

Select the correct board

Go to Tools → Board → Boards Manager, search for "M5Stack", install the package, then select:

Tools → Board → M5Stack → M5StickC-S3
3

Replace the M5Stack library include

The M5StickCPlus2 library does not support the S3. Use M5Unified instead:

// Remove:  #include <M5StickCPlus2.h>
// Add:     #include <M5Unified.h>
4

Install mcp_can library

In Arduino IDE go to Sketch → Include Library → Manage Libraries, search for:

mcp_can  (by coryjfowler)

Physical Pin Identification Guide

The M5StickC S3 has no G-number labels on the hardware. Use the diagrams below to identify each pin by its physical position on the connector.

Bottom HAT Connector — 8-pin header (underside of device)

M5StickC S3

bottom edge (USB-C side faces up)

1
GND
2
5V
3
G13
4
G14
5
G4
6
G12
7
G38
8
3V3

← Pin 1 (GND)    Pin 8 (3V3) →

#
Label
GPIO
Description
1
GND
Ground
2
5V
5 V from USB / battery
3
G13
G13
SPI MOSI — data to MCP2515
4
G14
G14
SPI CLK — clock signal
5
G4
G4
SPI MISO — data from MCP2515
6
G12
G12
SPI CS — chip select (active LOW)
7
G38
G38
INT — interrupt from MCP2515 (optional)
8
3V3
3.3 V output — power for MCP2515

Grove Port — 4-pin JST connector (right side of device)

Grove Port
1
GND
2
5V
3
G2
4
G1
#
Label
GPIO
Description
1
GND
Ground
2
5V
5 V power
3
G2
G2
Grove SDA / GPIO 2
4
G1
G1
Grove SCL / GPIO 1

How to orient the connector: Hold the M5StickC S3 with the screen facing you and the USB-C port at the top. The 8-pin HAT header is on the bottom edge. Pin 1 (GND, black) is on the left, Pin 8 (3V3, red) is on the right. The small triangle or notch on the PCB silkscreen marks Pin 1.

SPI Signal Wiring

M5Stick PinFunctionWireMCP2515 PinFunction
G13SPI MOSI
SIMOSI In
G4SPI MISO
SOMISO Out
G14SPI CLK
SCKClock
G12SPI CS
CSChip Select
G38INT (optional)
INTInterrupt

Power & Ground

M5Stick PinFunctionWireMCP2515 PinFunction
3V33.3 V Out
VCCPower In
GNDGround
GNDGround

CAN Bus → OBD-II Connector

MCP2515 Module Output

CANHCAN High — connect to Jeep OBD-II pin 6 (CAN High)
CANLCAN Low — connect to Jeep OBD-II pin 14 (CAN Low)

OBD-II J1962 Connector (relevant pins)

4
Chassis GND
5
Signal GND
6
CAN High (HS)
14
CAN Low (HS)
16
+12 V Battery

Wiring Overview Diagram

  M5StickC S3 (ESP32-S3)                  MCP2515 Module
  ┌─────────────────────┐                  ┌──────────────────┐
  │  G13 (MOSI) ────────┼──── yellow ──────┼── SI             │
  │  G4  (MISO) ────────┼──── blue   ──────┼── SO             │
  │  G14 (CLK)  ────────┼──── orange ──────┼── SCK            │
  │  G12 (CS)   ────────┼──── green  ──────┼── CS             │
  │  G38 (INT)  ────────┼──── purple ──────┼── INT (optional) │
  │  3V3        ────────┼──── red    ──────┼── VCC            │
  │  GND        ────────┼──── black  ──────┼── GND            │
  └─────────────────────┘                  │                  │
                                           │  CANH ───────────┼── OBD-II Pin 6
                                           │  CANL ───────────┼── OBD-II Pin 14
                                           └──────────────────┘

GPIO 36 and GPIO 37 do NOT exist on the ESP32-S3. Do not use the Plus 2 pin assignments — they will cause a boot failure or no-op.

GPIO 0 is a strapping pin on the ESP32-S3 and controls boot mode. Never use GPIO 0 as MOSI on the S3.

Verify your MCP2515 breakout board operates at 3.3 V. Some modules are 5 V only and will damage the S3 GPIO pins.

Arduino IDE board selection: open Boards Manager, install "M5Stack" package, then select Tools → Board → M5Stack → M5StickC-S3.

Replace #include <M5StickCPlus2.h> with #include <M5Unified.h>. M5Unified works across all M5Stack devices including the S3 and requires no other code changes for basic init.

SPI.begin(SCK, MISO, MOSI, CS) syntax is identical on ESP32-S3 — only the pin numbers change.

Jeep Grand Cherokee HS-CAN runs at 500 kbps. Set MCP2515 bitrate to CAN_500KBPS in firmware.

Use twisted-pair wire for CANH/CANL runs longer than ~10 cm to reduce noise.

The MCP2515 module typically includes a built-in 120 Ω termination resistor. The Jeep bus already has terminators — you may need to remove the module resistor if you see bus errors.

Recommended library: mcp_can by coryjfowler (GitHub: coryjfowler/MCP_CAN_lib) — compatible with ESP32-S3 without modification.

Arduino / M5Stack Firmware SnippetM5StickC S3

#include <M5Unified.h>      // replaces M5StickCPlus2.h for S3
#include <mcp_can.h>
#include <SPI.h>

#define CAN_CS_PIN  12   // G12
#define CAN_INT_PIN 38   // G38 (optional)

MCP_CAN CAN(CAN_CS_PIN);

void setup() {
  M5.begin();
  // SCK=G14, MISO=G4, MOSI=G13, CS=G12
  SPI.begin(14, 4, 13, 12);

  if (CAN.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) == CAN_OK) {
    Serial.println("MCP2515 init OK");
  }
  CAN.setMode(MCP_NORMAL);
}

void loop() {
  if (CAN.checkReceive() == CAN_MSGAVAIL) {
    long unsigned int rxId;
    unsigned char len;
    unsigned char rxBuf[8];
    CAN.readMsgBuf(&rxId, &len, rxBuf);
    // Process OBD-II frame here
  }
}