Page 1 of 1

ESP internal CAN

Posted: Wed Sep 05, 2018 3:15 pm
by PeterR
Hi,
I am attempting to get the internal CAN running.
I am using https://github.com/ThomasBarth/ESP32-CAN-Driver with pins TX:5, RX: 4
I have also tried with an ESP32-EVB and TX:5, RX:35

Hooking probes onto GPIO_NUM_4 and GPIO_NUM_5 shows no activity.

The SJA1000 registers on reset (0x):
MOD: 76, CMR: 76, SR: 76, IR: 76, IER: 76, BTR0: 76, BTR1: 76

Following CAN_init() & CAN_write_frame():
MOD: 00, CMR: 00, SR: 0c, IR: 00, IER: ff, BTR0: 53, BTR1: 9c

Then:
MOD: 01, CMR: 00, SR: d4, IR: 00, IER: ff, BTR0: 53, BTR1: 9c

So I seem to have entered RM. Why? Also the registers do not seem to reflect SJA1000 power on/reset values.
Has anyone got the internal CAN working? If so please provide links.

Re: ESP internal CAN

Posted: Wed Sep 05, 2018 5:40 pm
by jcsbanks
There is now a CAN driver in esp-idf too.

It works fine with ESP32-EVB.

Do you have a CAN device to give ACKs and termination link closed on the ESP32-EVB or another 120R?

Re: ESP internal CAN

Posted: Thu Sep 06, 2018 8:38 am
by PeterR
Thanks. Awesome, I will try the IDF driver. I tried the EVB with termination, CANdo etc & my production board just monitoring TX & RX. No signals. I will try the driver though.

Re: ESP internal CAN

Posted: Thu Sep 06, 2018 11:31 am
by PeterR
Great that works (once I type in the correct GPIO numbers)

Something which may not be obvious to all is that on the ESP32-EVB rev D:
CAN-HI is next to the circular power in.
CAN-LOW is middle.

Thanks for the help.