ESP32 CAN controller

Gilbert
Posts: 41
Joined: Wed Sep 16, 2020 2:58 pm

ESP32 CAN controller

Postby Gilbert » Mon Jan 17, 2022 12:16 pm

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?

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 CAN controller

Postby ESP_Sprite » Tue Jan 18, 2022 1:28 am

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.

Gilbert
Posts: 41
Joined: Wed Sep 16, 2020 2:58 pm

Re: ESP32 CAN controller

Postby Gilbert » Fri Jan 21, 2022 9:11 am

Thank you. RTOS is not my forte, hence my lack of understanding.

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 CAN controller

Postby ESP_Sprite » Fri Jan 21, 2022 12:18 pm

No worries, I can imagine that the distinction is subtle if you're not used to RTOSses.

Who is online

Users browsing this forum: Baidu [Spider] and 50 guests