Nano CAN

9 views
Skip to first unread message

Dr. Gadget

unread,
Mar 30, 2021, 11:30:07 AM3/30/21
to Arch Reactor

Interested in controlling a CAN motor with a Nano, .. is anyone else in that world?

    Thanks!

Chris Weiss

unread,
Mar 30, 2021, 12:32:39 PM3/30/21
to Arch Reactor
I've looked at CAN for a couple things.  you need a transceiver and protocol docs, then it's not any harder than implementing any other serial protocol.  If you're lucky someone's already made a library for the protocol you need.

Eric Terry

unread,
Mar 30, 2021, 1:29:40 PM3/30/21
to arch-r...@googlegroups.com
what is CAN please?


On Tue, Mar 30, 2021 at 11:32 AM Chris Weiss <cwe...@gmail.com> wrote:
I've looked at CAN for a couple things.  you need a transceiver and protocol docs, then it's not any harder than implementing any other serial protocol.  If you're lucky someone's already made a library for the protocol you need.

--
You received this message because you are subscribed to the Google Groups "Arch Reactor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arch-reactor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arch-reactor/CAEhO07NJMC015jvs411_m4QRaUvgnyrhyH-SLG8G8G86Nz4JzA%40mail.gmail.com.

Chris Weiss

unread,
Mar 30, 2021, 1:47:38 PM3/30/21
to Arch Reactor

https://en.wikipedia.org/wiki/CAN_bus

most commonly used in vehicles, but has been adopted for general industrial use as well.

Ray Scheufler

unread,
Mar 30, 2021, 3:13:17 PM3/30/21
to arch-r...@googlegroups.com
Specifically to support CAN on an arduino nano you will also need an external CAN Controller and a CAN transceiver.  The CAN Controller talks SPI or I2C to the AVR and generates the framing / checksumming as well as generating the correctly timed pulses on the TX pin and verifying messages coming in on the RX pin.  The CAN Transceiver takes the RX / TX lines as TTL signals and turns them into the differential signals that the bus needs.  Note that you can get a controller with integrated transceiver.  You can also get a different microcontroller that has the CAN controller built into it.  I don't know of anyone that makes a microcontroller with built in CAN controller and CAN transceiver.  Once you have MCU + Controller + Transceiver you are able to send / receive CAN messages.  I believe that there are arduino libraries for interacting with a MCP2515 SPI based external can controller.

Additionally you will need to know what kinds of messages to send.  CAN is designed around the concept of messages which are Identifier + Data.  The Identifier is either 11 bits (standard) or 29 bits (extended).  Generally on a network you only use one type of identifier, but the protocol does allow mixing standard and extended.  The Data is up to 8 bytes.  There is also a CRC and some start / end frame stuff but the controller takes care of that for you. 

I would expect your motor controller to have a CAN interface that works by you sending a packet with a specific identifier and data bytes interpreted as voltage / current commands.  The motor controller would respond with a different identifier as a "status" of what the voltage / current is measured at.  There may be additional messages for things like encoder feedback, but this is all speculation and you would need the protocol spec for the controller.

Ray Scheufler


On Tue, Mar 30, 2021 at 12:47 PM Chris Weiss <cwe...@gmail.com> wrote:

https://en.wikipedia.org/wiki/CAN_bus

most commonly used in vehicles, but has been adopted for general industrial use as well.

--
You received this message because you are subscribed to the Google Groups "Arch Reactor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arch-reactor...@googlegroups.com.

Arch Reactor, Sergeant At Arms

unread,
Mar 30, 2021, 4:23:43 PM3/30/21
to arch-r...@googlegroups.com

Arch Reactor, Sergeant At Arms

unread,
Mar 30, 2021, 4:27:35 PM3/30/21
to arch-r...@googlegroups.com
Actually it's available - https://www.adafruit.com/product/4759

$25.

L. V. Lammert

unread,
Mar 30, 2021, 4:32:57 PM3/30/21
to arch-r...@googlegroups.com
On Tue, 30 Mar 2021, Arch Reactor, Sergeant At Arms wrote:

> Actually it's available - https://www.adafruit.com/product/4759
>
> $25.
>
So many Nanos - is Feather pin compatible with a Nano?

Thanks!!

Ray Scheufler

unread,
Mar 30, 2021, 4:36:17 PM3/30/21
to arch-r...@googlegroups.com
When I say "Nano" I am explicitly referring to the Arduino Nano board that has a ATMEGA 328P chip on it.  I don't know about pin compatibility with other small boards. 

That feather board actually has the Transceiver as well.  You just hook CAN H, CAN L, and GND up to the screw terminals and you are good to go. 

Other notable small dev boards that have Controllers (but not transceivers):
The "Blue Pill" STM boards (have arduino support)
Most of the Teensy boards
ESP32

Transceivers are pretty easy.  You supply 5V, GND, wire the TX / RX to your Controller and wire CAN H and CAN L to the bus.  I believe that normally transceivers are separate from the main controller because they are closer to power electronics than they are to processor electronics.  I suspect that they would use a bunch of die area for the output transistors that designers would rather dedicate to cpu design.

Note that with CAN you need to have termination resistors.  Nominally you are supposed to use twisted pair and terminate with 120 ohm resistance.  Practically, you can use whatever resistor is closest to 120 ohm just fine. 

Ray Scheufler

Eric Terry

unread,
Mar 30, 2021, 5:27:00 PM3/30/21
to arch-r...@googlegroups.com
are we sure the original poster isn't referring to a "can" style dc motor? 

--
You received this message because you are subscribed to the Google Groups "Arch Reactor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arch-reactor...@googlegroups.com.

L V Lammert

unread,
Mar 30, 2021, 5:29:02 PM3/30/21
to arch-r...@googlegroups.com
Did not know CAN would support AC?

In this case, power is 24VDC.

You received this message because you are subscribed to a topic in the Google Groups "Arch Reactor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/arch-reactor/BgL8J1Attxs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to arch-reactor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arch-reactor/CAPax66eGRQkHK8NeDXfb3D%2BUe-2cU%2BPUp2dtCcb7CAoYK0pe7g%40mail.gmail.com.

Chris Weiss

unread,
Mar 30, 2021, 5:33:43 PM3/30/21
to Arch Reactor

communication and power are separate things, so yes, there are AC devices that speak CAN, especially big servomotors.

Eric Terry

unread,
Mar 30, 2021, 5:35:31 PM3/30/21
to arch-r...@googlegroups.com
LV,
just wanted verification you were talking about the CAN bus as opposed to a little dc motor frequently found on $10 walmart toys, and frequently referred to as "can motors". If you're looking to control something like that, the CAN bus would likely be crazy overkill

Reply all
Reply to author
Forward
0 new messages