Page 1 of 1

ESP32 CAN Bus Pinout

Posted: Thu Dec 17, 2020 7:43 am
by Pak00_ESP
Hi,

I designed custom board using ESP32-WROOM-32D. I can't find information on which pins I can put the CAN bus. Are there specific pins assigned to the CAN bus ?

Thank you very much!

Re: ESP32 CAN Bus Pinout

Posted: Thu Dec 17, 2020 9:29 am
by ESP_Dazz
Pak00_ESP wrote: Hi,

I designed custom board using ESP32-WROOM-32D. I can't find information on which pins I can put the CAN bus. Are there specific pins assigned to the CAN bus ?

Thank you very much!
No, there are no specific pins for TWAI/CAN. All the of TWAI/CAN signals (e.g., TX, RX, CLKOUT, BUS_OFF) are routed through the GPIO matrix, thus you are able to select which pin you want to assign for each of those signals via the driver configuration. The current CAN examples default the TX and RX signal to GPIOs 21 and 22 respectively on the ESP32, with CLKOUT and BUS_OFF being left unused). But you are free to change them to the pins of your choosing. Just make sure you pick an Input capable pin for RX and output capable pin for TX.

Note that you'll need to hook up the TX and RX signal to an external CAN transceiver.