Site Information

 Loading... Please wait...

Blog

ESP32 Processor: CAN Bus Topology and Termination Resistors

Posted by Wilfried Voss on

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

It is my experience that newcomers to the technology overlook the importance of termination resistors. Missing or misplaced resistors can lead to transmission errors or even prevent transmission altogether.

The general rule is that if you connect to an existing, fully functional network, you do not need to add any termination resistors. If you create a new network, please pay close attention to the topic as explained in the following.

The image above demonstrates a simple CAN network. All nodes are connected by two wires, CAN_H and CAN_L. The bus line is terminated by resistors, which are typically 120 Ω and are necessary to suppress any electrical reflections on the bus.

The termination resistors should always be connected at both ends of the bus; they should never be physically attached to a CAN node because removing this specific node would cause the bus to lose proper termination.

Note: The CAN standard allows for any bus topology, but a simple, straightforward architecture is advantageous for increased reliability. However, depending on the physical bus structure, it may be difficult to determine “both ends of the bus” and may require some trial and error.

According to ISO 11898-2, the termination resistor should be between 100…130 Ω, but typically 120 Ω, with a minimum power dissipation of 220 mW. Deviations from the nominal value of 120 Ω are possible, depending on the bus topology and the baud rate. As a rule of thumb, the lower the termination resistor, the fewer possible nodes in the network.

The wiring topology of a CAN network should be as straight as possible, using short cable lengths and avoiding complex network structures, even though almost any network structure is possible under CAN.

The maximum bus length (L) depends on the baud rate used. The table below displays some network topology parameters at the maximum baud rate of 1 Mbit/sec.

Parameter Maximum Length [ft] / [m]
L - Bus Length 120 / 40
l - Cable Stub Length 1 / 0.3
d - Node Distance 120 /40

The bus length can be significantly extended at lower baud rates. The following image demonstrates the relationship between CAN baud rate and maximum physical network length.


ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module

This board has an ESP32 WROOM-32 WiFi, Bluetooth Classic, BLE Module, and a CAN Bus port with a transceiver onboard. It also has 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 a USB-C connector, automatic bootloader, and reset. The ESP32 is a low-cost, low-power system-on-chip microcontroller with integrated Wi-Fi 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 baluns, a power amplifier, a low-noise receive amplifier, filters, and power management modules.  More Information...

ESP32 Development Kits with Onboard CAN Bus Controller

The ESP32 is a low-cost, low-power system-on-chip microcontroller with integrated WiFi and dual-mode Bluetooth. It is equipped with a Tensilica Xtensa LX6 microprocessor in dual-core and single-core versions. The microcontroller features built-in antenna switches, RF balun, power amplifiers, low-noise receive amplifiers, filters, and power management modules. It is the successor to the ESP8266 SoC. There are [...]

Read More »


ESP32 Processor: Adding CAN/CAN-FD Controllers per SPI Port

This post is an excerpt from our application note Controller Area Network (CAN) Development with ESP32. The internal CAN controller SJA1000 does not support CAN-FD and is not CAN-FD tolerant. To use CAN-FD with the ESP32, you need to employ CAN-FD breakout boards that are accessible per the ESP32’s SPI ports. Note: The SPI ports are not [...]

Read More »


ESP32 Processor: Internal SJA 100 CAN Bus Controller

This post is an excerpt from our application note Controller Area Network (CAN) Development with ESP32.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 [...]

Read More »


ESP32 Processor: Adding a CAN Bus Transceiver

This post is an excerpt from our application note Controller Area Network (CAN) Development with ESP32.As a quick reference, I want to address the need for a CAN transceiver. As mentioned in the previous chapter, the ESP32 has an internal CAN Bus controller. However, this doesn't mean you can directly connect it to a network. You [...]

Read More »


CAN FD (Controller Area Network Flexible Data Rate)

This post is an excerpt from our application note  Controller Area Network (CAN) Development with ESP32. CAN FD (Controller Area Network Flexible Data Rate) is an extension of the original CAN bus protocol. It was created to provide increased bandwidth within automotive and industrial networks. It brings application software closer to "real-time" by minimizing delays between instruction [...]

Read More »


ESP32 Processor with Internal SJA 1000 CAN Bus Controller

This post is an excerpt from our application note Controller Area Network (CAN) Development with ESP32. The 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 [...]

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 »


ESP32: CAN Bus Programming with MCP2515 and MCP2517FD

For good reasons, the ESP32 processor is a prevalent choice for embedded hardware development. Besides considerable memory resources, it provides various hardware features for many applications, most prominently the Internet of Things (IoT). All that comes with more than reasonable price tags, specifically when you use one of the multiple ESP32 development modules. And since [...]

Read More »


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 »