Site Information

 Loading... Please wait...

Blog

ESP32 Processor with Internal SJA 1000 CAN Bus Controller

Posted by Wilfried Voss on

This post is an excerpt from our application note Controller Area Network (CAN) Development with ESP32.

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus ModuleThe ESP32 is a low-cost, low-power system-on-chip microcontroller with integrated WiFi and dual-mode Bluetooth. It employs a Tensilica Xtensa LX6 microprocessor in dual-core and single-core variations. It includes built-in antenna switches, RF balun, power amplifiers, low-noise receive amplifiers, filters, and power management modules. It is a successor to the ESP8266 SoC.

As practiced throughout this application note, I will not repeat details that are already available online but rather point to the ultimate source for information on the ESP32 processor: ESP32 WiFi & Bluetooth MCU I Espressif Systems.

ESP32 Features

  • Single or Dual-Core 32-bit LX6 Microprocessor with clock frequency up to 240 MHz.
  • 520 KB of SRAM, 448 KB of ROM, and 16 KB of RTC SRAM.
  • Supports 802.11 b/g/n WiFi connectivity with speeds up to 150 Mbps.
  • Support for both Classic Bluetooth v4.2 and BLE specifications.
  • 34 Programmable GPIOs.
  • Up to 18 channels of 12-bit SAR ADC and 2 channels of 8-bit DAC
  • Serial Connectivity includes 4 x SPI, 2 x I2C, 2 x I2S, 3 x UART.
  • Ethernet MAC is used for physical LAN communication (requires external PHY).
  • 1 Host controller for SD/SDIO/MMC and 1 Slave controller for SDIO/SPI.
  • Motor PWM and up to 16 channels of LED PWM.
  • Secure Boot and Flash Encryption.
  • Cryptographic Hardware Acceleration for AES, Hash (SHA-2), RSA, ECC, and RNG.

ESP32 Board Components

  • ESP-WROOM-32 Module
  • Two rows of IO Pins (with 15 pins on each side)
  • CP2012 USB – UART Bridge IC
  • Micro–USB Connector (for power and programming)
  • AMS1117 3.3V Regulator IC
  • Enable Button (for Reset)
  • Boot Button (for flashing)
  • Power LED (Red)
  • Some passive components

Further Development Resources


Internet of Things Projects with ESP32: Build exciting and powerful IoT projects using the all-new Espressif ESP32Internet of Things Projects with ESP32: Build exciting and powerful IoT projects

The ESP32, a low-cost MCU with integrated Wi-Fi and BLE capabilities, has various modules and development boards for efficiently building IoT applications. Wi-Fi and BLE are standard network stacks for Internet-of-Things applications, providing cost-effective solutions for your business and project requirements.

This book is a fundamental guide for developing ESP32 programs. It starts by explaining GPIO (General Purpose I/O) programming with sensor devices. The reader gets up to speed with ESP32 development through several IoT projects, such as weather stations, sensor loggers, smart homes, Wi-Fi cams, and Wi-Fi wardriving. The reader learns how to use ESP32 boards to facilitate interactions between mobile applications and cloud servers, such as AWS.  More Information...


Internal SJA 1000 CAN Controller

The ESP32 integrates a CAN Bus controller compatible with the NXP SJA1000. Thus, it is CAN 2.0B (ISO 11898, a.k.a. Classical CAN) specification-compliant.

As with the SJA1000, the ESP32 CAN Bus controller provides only the data link layer and the physical layer signaling sublayer. Therefore, an external transceiver module is required, which converts the ESP32's CAN-RX and CAN-TX signals into CAN_H and CAN_L bus signals. The transceiver, such as the MCP2551 or SN65HVD23X, provides compatibility with ISO 11898-2.

Note: The SJA1000 does not support CAN-FD and is not CAN-FD tolerant. To implement CAN-FD with the ESP32, you must utilize CAN-FD breakout boards accessible via the SPI port.

Adding a CAN Bus Transceiver

As with many other ESP32 hardware features, the CAN controller output (CAN_TX, CAN_RX) can be assigned to almost any GPIO. In the following, we assume GPIO25 (CAN_TX) and GPIO26 (CAN_RX), which appear to be a virtual standard in the industry.

The following image shows a schematic utilizing the popular SN65HVD CAN transceiver:

Alternatively, you can use our ESP32 WiFi, Bluetooth Classic, BLE, and CAN Bus Module to avoid hardware assembly via breadboard and external breakout boards.

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Mod

This board has an onboard ESP32 WROOM-32 WiFi, Bluetooth Classic, BLE Module, and a CAN Bus port with a transceiver. Also onboard are an RGB LED and IO pins on a 0.1" pad. Programming is accomplished through the popular Arduino IDE connected to the USB-to-Serial converter with USB-C connector, automatic bootloader, and reset.

The ESP32 is a low-cost, low-power system-on-chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations and includes built-in antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. More Information...

Single-Channel USB-CAN PC Interface with SAE J1939-13 Type II Connector

The Leaf Light HS v2 J1939-13 Type II, a standout in Kvaser's Leaf Light product series, is renowned for its reliability and affordability in connecting any CAN network to a PC or mobile computer. It's not just a workhorse but a dependable and cost-effective solution. The Leaf Light HS v2 J1939-13 Type II is a device that [...]

Read More »


Diesel Decoder – Turn Your Smartphone into a Heavy-Duty Diagnostics Tool

Turn your smartphone into a user-friendly HD diagnostic tool. Download and sync via Bluetooth to the free Diesel Decoder smartphone app to view vital diagnostic and trip data. When your rig throws a fault code, the Diesel Decoder is your reliable companion. It removes the guesswork, guiding you to either clear the codes and continue your journey [...]

Read More »


Literature on Maritime Electronics, Including NMEA 2000

Replacing Your Boat's Electrical System The electrical system on a boat is crucial for the operation of all manner of valuable and critical equipment, yet a simple failure or weakness can render these systems inoperable. In older boats, fatigued or damaged wiring can be problematic or even terminal, so Mike Westin shows how to replace a [...]

Read More »


Embedded Systems for NMEA 2000 Development and Prototyping Support Marine Applications

Copperhill Technologies offers  Arduino-Compatible NMEA 2000 development boards and an NMEA 0183/NMEA 2000 HAT for the Raspberry Pi, ideal for marine applications such as OpenCPN, OpenPlotter, Signal K, and CANBoat. Experience cutting-edge technology with our NMEA 2000 development and prototyping boards, specially crafted for marine applications. These boards are game changers, allowing you to develop and [...]

Read More »


OBD-II and the Hacking of Automotive CAN Bus Networks

Let me clarify: this is not a guide to hacking automotive networks. Instead, I attempt to dismiss some common misconceptions about OBD-II and its supposed ability to control a vehicle (Spoiler alert: It cannot). As someone who has spent considerable time studying and working with CAN Bus technologies, I think it is time to set [...]

Read More »


Testing PICAN CAN Bus HATs with the Raspberry Pi 5

The new Raspberry Pi 5 features the Broadcom BCM2712 quad-core Arm Cortex A76 processor @ 2.4GHz, up to three times faster than the previous generation. With RAM variants up to 8GB, this is the fastest, smoothest Raspberry Pi experience yet. The latest release of Raspberry Pi OS was made to maximize Raspberry Pi 5's potential. The [...]

Read More »


Configurable Display for Off-Road Vehicle Engines with SAE J1939 interface

The EngineMonitorPlus is a display and control device with a CAN Bus interface designed specifically for use in off-road vehicle engines. It supports the most common messages (PGN, Parameter Group Number) of the SAE J1939 standard. Furthermore, it provides a simple configuration of displayed parameters, errors (DM1), and service messages, allowing the user to configure and [...]

Read More »


Bluetooth OBD2 Scanner and Car Code Reader for iPhone & Android

EASY-TO-USE OBD2 APP & CAR CODE READER - The FIXD car scanner and OBD app instantly translates 7000+ engine fault codes into plain English on your phone. Wireless Bluetooth connection. Set up in minutes. No car knowledge needed. FIND OUT WHAT’S WRONG WITH YOUR CAR - Even beginners can use the FIXD OBD2 scanner and app [...]

Read More »


ESP32 Programming - Classical CAN to Bluetooth Gateway

In this post, I will present a CAN to Bluetooth gateway based on the ESP32 processor. The above image shows my test setup using our ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module, a CAN-Bus Hub With 7 Ports And DC Power Connection, and the PCAN-USB Pro. As its description implies, the ESP32 module provides all necessary [...]

Read More »