Need help with CAN bus...

Status
Not open for further replies.

Bullone

Well-known member
Hi guys,
I've just received that CAN transceivers (hope they are ok for Teensy!):
https://www.ebay.it/itm/2pcs-SN65HV...e=STRK:MEBIDX:IT&_trksid=p2060353.m2749.l2649

I've connected the Teensy v3.6 CAN-TX pin with the CTX of transceiver and Teensy CAN-RX to the CRX...
Can you please point me to the best CAN library to use? I need to get connected to the CAN bus of my bike at 500kbps and ask with OBD messages for RPM, TPS and ECT...
On my old project with Arduino MEGA I've used the MCP library and it has a loopback mode so I was able to test the connections and SW without connecting physically to the CAN bus of the bike: in loopback mode everything is sent to the CAN bus is received back.... is there a similar feature?
Have I need the 120ohm resistor with Teensy?


Sorry, I'm new on CAN :)
 
You can try the IFCT library. Check this thread - do a search for MCP with that thread and you will find that whatever you have for MCP should work with the IFCT Lib. There should be some examples in there as well.
 
I am currently using the FlexCAN library included with Teensyduino with the same transceiver as this product, I’ve got mine on a custom PCB. It is very easy to use. You won’t have loopback mode with the Teensy and this library.

From the picture, this board has a 120 ohm resistor onboard. It is between CAN HI and CAN LO labelled 121. If you want to use this product in an existing CAN BUS, you will have to remove this resistor. The bus wires in a CAN network are terminated at both ends with 120 ohm resistors.

You will need 120 ohm impedance twisted pair for CAN HI and CAN LO when you connect to the bike’s bus. Keep these wires as short as possible. If you cannot find 120 ohm twisted pair in your area, ethernet cable should work just fine ( it is 100 ohm impedance ). The CAN protocol is very fault tolerant.

If you have any more questions, I’ll be happy to help.

https://e2e.ti.com/support/interface/f/138/t/161564?Using-CAT5-Ethernet-cables-for-CAN
 
Status
Not open for further replies.
Back
Top