]> granicus.if.org Git - esp-idf/blob - examples/peripherals/can/can_self_test/README.md
CAN Driver
[esp-idf] / examples / peripherals / can / can_self_test / README.md
1 # CAN Self Test Example
2
3 ## Overview
4 The CAN Self Test Example demonstrates the self testing capabilities of the
5 ESP32 CAN peripheral and **only requires a single ESP32 module to run**.
6 The Self Test Example can be used to verify that the wiring between the ESP32 
7 and an external transceiver operates correctly.
8
9 The CAN Self Test Example will do the following over multiple iterations:
10
11 1. Start the CAN driver
12 2. Simultaneously transmit and receive messages using the self reception request.
13 3. Stop the CAN driver
14
15 ## External Transceiver and Pin Assignment
16 The CAN controller in the ESP32 **does not contain an internal transceiver**.
17 Therefore users are responsible for providing an external transceiver compatible
18 with the physical layer specifications of their target ISO standard (such as 
19 SN65HVD23X transceivers for ISO 11898-2 compatibility)
20
21 The CAN controller in the ESP32 represents dominant bits to the transceiver as 
22 logic low, and recessive bits as logic high. The Self Test Example utilizes the 
23 following default pin assignments
24
25 * TX Pin is routed to GPIO21
26 * RX Pin is routed to GPIO22
27
28 ## Note
29 If the Self Test Example does not receive any messages, it is likely that the
30 wiring between the ESP32 and the external transceiver is incorrect. To verify
31 that the CAN controller in the ESP32 is operating correctly, users can bypass
32 the external transceiver by connecting the TX Pin directly to the RX Pin when 
33 running the Self Test Example.