Skip to content

Add TWAI transmit example #8360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Add TWAI transmit example #8360

merged 1 commit into from
Jul 17, 2023

Conversation

designer2k2
Copy link
Contributor

Description of Change

Example showing how to transmit messages using the TWAI interface and a CAN transceiver.
It also uses the alerts to show how to set them up and react to them.

This is based on the receive example, adopted with the example from the api-reference for transmission: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/twai.html#message-transmission

Tests scenarios

I used an esp32-c3-devkit (ESP32-D0WDQ6) with a SN65HVD230 CAN transceiver.
This was attached between 2 Arduino Nano´s with a MCP2515/MCP2562 CAN interface, whereby they replayed a recording from a quite busy CAN bus.
The ESP32 is used to additionally transmit messages with this example into the bus and the output was observed.

Caution, when only another ESP32 is used to receive by the TWAI receive example the TWAI_MODE_LISTEN_ONLY has to be replaced with TWAI_MODE_NORMAL, otherwise there is no confirmation and the transmit example will fail.

Related links

The TWAI receive example: #7430

Example showing how to transmit messages using the TWAI interface and a CAN transceiver.
@CLAassistant
Copy link

CLAassistant commented Jun 27, 2023

CLA assistant check
All committers have signed the CLA.

@VojtechBartoska VojtechBartoska added the Type: Example Issue is related to specific example. label Jun 28, 2023
@SuGlider
Copy link
Collaborator

@designer2k2 - Thank you for the example!

@me-no-dev me-no-dev merged commit 5d2d4aa into espressif:master Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Example Issue is related to specific example.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants