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...

Discover IoT Development with ESP32 to Create Smart Devices

The ESP32 is a low-cost, low-power SoC (System on Chip) microcontroller with integrated WiFi and dual-mode Bluetooth. It has shipped over 100 million units as of 2018 and powers many WiFi devices on the market. This book supplies end-to-end coverage of building an IoT system from the ground up to secure data communication techniques from [...]

Read More »


Arduino Uno R4 Combines CAN Bus Port with IoT Capabilities

The  Arduino UNO R4 WiFi combines the RA4M1 microprocessor from Renesas with the ESP32-S3 from Espressif, forming an all-in-one tool for engineers with improved processing power and a diverse array of new peripherals. With built-in Wi-Fi and Bluetooth abilities, the UNO R4 WiFi allows makers to launch into unlimited innovative opportunities. Likewise, this universal board boasts a [...]

Read More »


Programmable CAN Bus to USB, Bluetooth, BLE, WiFi Gateway

For the longest time, I had resisted the idea of creating my version of a CAN-to-USB gateway, primarily due to the vast competition. A professional CAN/J1939 development requires a professional CAN-to-PC solution to monitor data traffic. I am pleased with the PEAK PCAN-USB device, as shown in the above image. However, not everybody is willing [...]

Read More »


Selection Criteria and Requirements for a Telematics Gateway

The  March 2023 issue of the CAN Newsletter, a CiA (CAN-in-Automation) online publication, posted an article on the selection criteria and requirements for a Telematics gateway. With cars evolving towards network technologies, OEMs (Original Equipment Manufacturers) require telematics solutions that boost seamless communication within and outside the vehicle. The device should be cloud-enabled, connectable to servers for real-time [...]

Read More »


J1939 Protocol Stack Sketch for ESP32 Using the Arduino IDE

The ESP32 is a series of 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. Furthermore, the processor provides the means to easily [...]

Read More »


ESP32 Project: USB to Bluetooth Gateway

The ESP32 processor allows the integration of Wi-Fi, Bluetooth, and Bluetooth LE (BLE) for a wide range of IoT (Internet of Things) applications. Using Wi-Fi ensures connectivity within a large radius. At the same time, Bluetooth allows the user to easily detect (with low-energy beacons) a module and connect it to an Android/iOS smartphone or [...]

Read More »


Controller Area Network (CAN), SAE J1939, NMEA 2000 Wireless Module for IoT and ELD Applications

Due to the global shortage of electronic components, we at Copperhill Technologies began rethinking our strategy regarding new developments. Luckily, that change turned out to be a blessing in disguise because the transition from NXP LPC to the ESP32 processor opened the door to more industrial and automotive applications, especially those involving wireless transmissions for [...]

Read More »


Raspberry Pi Compute Module With CAN FD for Automation and IoT Applications

Kontron announced the release of their Pi-Tron CM4 computer with Linux OS, which utilizes the fourth-generation Raspberry Pi compute module with the 1,5-GHz, 64-bit Broadcom BCM2711 chip and four Arm Cortex-A72 processors. The computer’s steel housing allows for universal use, e.g., for automation and IoT (Internet of Things) applications. Depending on the variant, it provides a 1-GiB, 2-GB, [...]

Read More »


ESP32 Starter and Development Kits for Building Bluetooth and WiFi Enabled IoT Devices

The integration of Wi-Fi, Bluetooth, and Bluetooth LE allow a wide range of applications with ESP32 modules. Using Wi-Fi ensures connectivity within a large radius, while using Bluetooth allows the user to easily detect (with low-energy beacons) a module and connect it to a smartphone. The chips add priceless functionality and versatility to your applications [...]

Read More »