Getting CAN working on a Teensy 3.6: Difference between revisions

From openinverter.org wiki
Jump to navigation Jump to search
Clanger9 (talk | contribs)
Created page with "A Teensy 3.6 is an ideal board for making a CAN-compatible device. It's generally compatible with Arduino sketches and hardware, which makes it relatively simple to go from an..."
 
Clanger9 (talk | contribs)
Line 3: Line 3:
The Teensy IDE is a modified version of the Arduino software. You can download it [https://www.pjrc.com/teensy/td_download.html here]. Even though it's a separate program, it will make use of your previously-installed Arduino libraries and sketches. Which is pretty neat.
The Teensy IDE is a modified version of the Arduino software. You can download it [https://www.pjrc.com/teensy/td_download.html here]. Even though it's a separate program, it will make use of your previously-installed Arduino libraries and sketches. Which is pretty neat.
== Connect your CAN transceivers ==
== Connect your CAN transceivers ==
[[File:Teensy 3.6 CAN connections.png|thumb|Teensy 3.6 CAN connections]]
Good news: you can use the same SN65HVD230-based CAN transceivers that you [[CAN bus with Arduino Due|use with a Due]]. Connect them up using the pinout guide shown.
Good news: you can use the same SN65HVD230-based CAN transceivers that you [[CAN bus with Arduino Due|use with a Due]]. Connect them up using the pinout guide shown.
== Test your CAN link ==
== Test your CAN link ==
Connect the CAN bus on the two transceivers together (CANL to CANL, CANH to CANH)
Connect your computer to the USB port on the Teensy board.
Download the
In Teensyduino, go to ''Tools -> Manage Libraries...'' Type "due_can" in the search box and install "due_can"
''File -> Examples -> due_can -> CAN_ExtendedPingPong''
''Sketch -> Upload''
''Tools -> Serial Monitor''
If your CAN transceivers are working properly, you should be rewarded with incrementing numbers in the serial monitor window.

Revision as of 19:20, 10 November 2020

A Teensy 3.6 is an ideal board for making a CAN-compatible device. It's generally compatible with Arduino sketches and hardware, which makes it relatively simple to go from an Arduino-based prototype to the finished article.

Get Teensyduino

The Teensy IDE is a modified version of the Arduino software. You can download it here. Even though it's a separate program, it will make use of your previously-installed Arduino libraries and sketches. Which is pretty neat.

Connect your CAN transceivers

Teensy 3.6 CAN connections

Good news: you can use the same SN65HVD230-based CAN transceivers that you use with a Due. Connect them up using the pinout guide shown.

Test your CAN link

Connect the CAN bus on the two transceivers together (CANL to CANL, CANH to CANH)

Connect your computer to the USB port on the Teensy board.

Download the

In Teensyduino, go to Tools -> Manage Libraries... Type "due_can" in the search box and install "due_can"

File -> Examples -> due_can -> CAN_ExtendedPingPong

Sketch -> Upload

Tools -> Serial Monitor

If your CAN transceivers are working properly, you should be rewarded with incrementing numbers in the serial monitor window.