Page 1 of 1

Datasheet for CAN bus

Posted: Mon Apr 19, 2021 3:18 pm
by vincalvo
Hi there,

I am wondering why the CAN bus does not feature in the datasheet?
There is a question here on the forum that dates back to 2016 saying that it was coming.

Are you commited to CAN bus or is it a way to be able to deprecate it? Or is it known that it is buggy in any way?

CAN bus is a requirement for me and I am wondering if it is better to use a SPI version?
Thanks for letting me know.

Vince

Re: Datasheet for CAN bus

Posted: Tue Apr 20, 2021 2:09 am
by ESP_Sprite
It's a legal thing. If you want a protocol that speaks ISO 11898-3 (which is commonly refered to as 'CAN') look for the TWAI peripheral in any of the ESP32s.

Re: Datasheet for CAN bus

Posted: Tue Apr 20, 2021 5:20 am
by WiFive
There are bugs in the twai peripheral and they have been addressed in recent esp-idf commits

Re: Datasheet for CAN bus

Posted: Tue Apr 20, 2021 5:16 pm
by PeterR
Wifi, Do you have the commit details? I should check that all issues have been addressed.

There were at least 2 errors. (1) The driver would lock failed after overflow, reboot being the only recovery. Try switching interrupts off for 100mS and you will see. (2) Corrupt data getting through. I could force this issue by toggling the termination resistor.

I have used the patches for 6 months+ & I think them good.
My application uses CAN data for a display and so a glitch would only cause a display artifact. I added 'braces' protection to the patch's 'belt', strings being strings, ranges etc. No user reports so guess fixed. Unfortunately was not able to add stress tests to the backlog (accountants!).

Looks like I might have to change my signature, which would be great!

Re: Datasheet for CAN bus

Posted: Tue Apr 20, 2021 6:05 pm
by vincalvo
Ok !!! Thanks wifive, that makes sense.
Thank you all for the feedback on the libs. I will have a closer look soon.

Re: Datasheet for CAN bus

Posted: Tue Apr 20, 2021 6:31 pm
by WiFive
PeterR wrote:
Tue Apr 20, 2021 5:16 pm
Wifi, Do you have the commit details? I should check that all issues have been addressed.

There were at least 2 errors. (1) The driver would lock failed after overflow, reboot being the only recovery. Try switching interrupts off for 100mS and you will see. (2) Corrupt data getting through. I could force this issue by toggling the termination resistor.

I have used the patches for 6 months+ & I think them good.
My application uses CAN data for a display and so a glitch would only cause a display artifact. I added 'braces' protection to the patch's 'belt', strings being strings, ranges etc. No user reports so guess fixed. Unfortunately was not able to add stress tests to the backlog (accountants!).

Looks like I might have to change my signature, which would be great!
https://github.com/espressif/esp-idf/co ... 9b86d26e00

Re: Datasheet for CAN bus

Posted: Tue Feb 15, 2022 5:15 pm
by RidgeRacer
The ESP32 CAN internal registers and operation behave just like a Phillips SJA1000 CAN Controller. I have successfully used the SJA1000 datasheet to develop ESP32 CAN Bus apps.