teachop / FlexCAN_Library

Arduino library for CAN on Teensy 3.1
The Unlicense
155 stars 122 forks source link

Can message looping on Teensy 3.6 #27

Closed Ligozila closed 7 years ago

Ligozila commented 7 years ago

Good morning,

I am new to the CAN community and was trying on a project with testing the CAN bus line.

I have a Teensy 3.6 in hand. With Teensy having 2 Can line available, I am trying to send a message from Can0, receive from Can1 and compare the message. I still did not receive the CAN Transceivers module yet, and hopefully they will arrive soon. However, to test out the code, I have solder 1k resistors between the Can0_TX and Can1_RX, Can0_RX and Can1_TX, I hope this will emulate the signal from the CAN Transceivers in-between.

I have complied successfully and download the sketch "CANTest.ino" into Teensy, I have measured and got some kind of pulse signals from the Can0_TX and Can1_RX. Signal generated from Can0_TX and reach to Can1_RX via the 1k resistor.

Problem: It seems Can1_RX never reads the signal, Can1.available() always return 0.

Does the resistor linking between the Can TX and RX is valid? Is there some signal conditions, like pulling the line down or high to signal the line is available? do I need to make change to the sketch? or should I add another Teensy, so 1 transmit and another receive... etc

It will be great to have your advise and thought!

pawelsky commented 7 years ago

Does the resistor linking between the Can TX and RX is valid?

No it is not. Use proper CAN transceivers or at least http://www.cnblogs.com/shangdawei/p/4714957.html

Ligozila commented 7 years ago

Good Morning, Hope your guys have a happy long weekend. (It is a long weekend in NZ)

Thank you pawelsky for the reply. I was wondering does anyone done something similar, testing the code when there is not transceiver available in hand.

It is very useful, especially the setup for the TX and RX line.

Ligozila commented 7 years ago

The Pin setup works great. thank you for the great help