pierremolinaro / acan-t4

CAN / CANFD Arduino Library for Teensy 4.0
MIT License
17 stars 4 forks source link

Teensy 4.0 with MCP2515 canbus module #6

Closed nicolasdetracy closed 1 year ago

nicolasdetracy commented 1 year ago

Hi,

I am trying to send can bus messages with my Teensy 4.0 using an MCP2515 canbus module. How should the module be connected to the Teensy board and what code should I use?

Thanks in advance! Nicolas de Tracy

pierremolinaro commented 1 year ago

Hello,

If you want to connect a MCP2515 with your Teensy 4.0, the ACAN_T4 library is useless. This library uses the internal CAN controllers.

Considere the ACAN2515 library, or the ACAN2515Tiny librairies.

The ACAN2515 library contains a PDF documentation (in the extras directory) that explains the connection between the MCP2515 and a microcontroller, using a SPI bus.

The MCP2515 power should be 3.3V, as the Teensy 4.0 pins are not 5V tolerant.

Best Regards,

Pierre

Le 31 mars 2023 à 11:32, Nicolas de Tracy @.***> a écrit :

Hi,

I am trying to send can bus messages with my Teensy 4.0 using an MCP2515 canbus module. How should the module be connected to the Teensy board and what code should I use?

Thanks in advance! Nicolas de Tracy

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-t4/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVBXNC4LZKOUO2A2YDLW62QEDANCNFSM6AAAAAAWOM6STY. You are receiving this because you are subscribed to this thread.

nicolasdetracy commented 1 year ago

Hi Pierre,

Thank you for replying to my issue! I dit what you told me to do, I attached the mcp2515 to the Teensy 4.0 with a logic level converter in between the modules.

Using the ACAN2515 library, the first line that gets printed into the Serial is "ACAN2515 configuration error 0x1" and I'm pretty sure that the INT and CS pins are not the problem.

What could be the cause of this error message?

Nicolas de Tracy

pierremolinaro commented 1 year ago

Hi Nicolas,

This error means that the Teensy 4.0 is not able to communicate with the MCP2515. Check your connections. Make sure the MCP2515 power is 3.3V. What is the frequency of the oscillator that drives the MCP2515 ? You should report this frequency in your sketch.

Pierre

Le 2 avr. 2023 à 20:28, Nicolas de Tracy @.***> a écrit :

Hi Pierre,

Thank you for replying to my issue! I dit what you told me to do, I attached the mcp2515 to the Teensy 4.0 with a logic level converter in between the modules.

Using the ACAN2515 library, the first line that gets printed into the Serial is "ACAN2515 configuration error 0x1" and I'm pretty sure that the INT and CS pins are not the problem.

What could be the cause of this error message?

Nicolas de Tracy

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-t4/issues/6#issuecomment-1493409253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVD2A2OK7SDYDNHQEOTW7HALFANCNFSM6AAAAAAWOM6STY. You are receiving this because you commented.

pierremolinaro commented 1 year ago

Hello,

I have updated the ACAN2515 library, is the 0x01 error still present ?

Pierre

Le 2 avr. 2023 à 20:28, Nicolas de Tracy @.***> a écrit :

Hi Pierre,

Thank you for replying to my issue! I dit what you told me to do, I attached the mcp2515 to the Teensy 4.0 with a logic level converter in between the modules.

Using the ACAN2515 library, the first line that gets printed into the Serial is "ACAN2515 configuration error 0x1" and I'm pretty sure that the INT and CS pins are not the problem.

What could be the cause of this error message?

Nicolas de Tracy

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-t4/issues/6#issuecomment-1493409253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVD2A2OK7SDYDNHQEOTW7HALFANCNFSM6AAAAAAWOM6STY. You are receiving this because you commented.

nicolasdetracy commented 1 year ago

Hi Pierre!

I was going to clarify if I managed to use canbus with the teensy 4.0 this evening (Belgium).

I actually bought a sn65hvd230 canbus transceiver, connected it to my teensy 4.0 and used your FlexCAN_T4 library and it works.

I'm very happy that it works now. Unfortunately, I cannot test your ACAN2515 library anymore..

Kind Regards, Nicolas de Tracy