Page 1 of 1

ESP32 CAN controller

Posted: Mon Jan 17, 2022 12:16 pm
by Gilbert
I'm considering to use the intgrated CAN controller which in the new chip version supports lower bit times (down to 60 µs). I looked at example code and they all use a polling mechanism to find out about received messages. Is there no interrupt mechanism to announce the arrival of new messages, comparable to what MCP2515 offers?

Re: ESP32 CAN controller

Posted: Tue Jan 18, 2022 1:28 am
by ESP_Sprite
You're confusing polling with a task blocking on an event; the examples are doing the latter. The difference is that the first will spin the CPU, which is unwanted, while in the second case the RTOS will simply not execute the task until something happens on the CAN peripheral, which is something you generally do want.

Re: ESP32 CAN controller

Posted: Fri Jan 21, 2022 9:11 am
by Gilbert
Thank you. RTOS is not my forte, hence my lack of understanding.

Re: ESP32 CAN controller

Posted: Fri Jan 21, 2022 12:18 pm
by ESP_Sprite
No worries, I can imagine that the distinction is subtle if you're not used to RTOSses.