Teensy 4.1 CAN bus

SamiH

Member
I was wondering how many Waveshare SN65HVD230 CAN Board I can connect to teensy a 4.1 and use using the (https://github.com/tonton81/FlexCAN_T4)
library.

Previously I have used 3 of the above mentioned can boards with a teensy 4.1.

On the teensy 4.1 DOCs it says there is 3 CAN Bus. Is there nay way to extend that?

Can I use more than 3, if so how do i start.

TIA
 
I was wondering how many Waveshare SN65HVD230 CAN Board I can connect to teensy a 4.1 and use using the (https://github.com/tonton81/FlexCAN_T4)
library.

Previously I have used 3 of the above mentioned can boards with a teensy 4.1.

On the teensy 4.1 DOCs it says there is 3 CAN Bus. Is there nay way to extend that?

Can I use more than 3, if so how do i start.

TIA

I'm not familiar with this waveshare board you mention but an SN65HVD230 is a transceiver only and thus you could use three of those to get three CAN buses at the same time. You can extend the number of buses by adding SPI connected CAN modules (MCP2518/MCP2518FD). With such modules are you limited only by the SPI bus bandwidth and the number of chip select pins you can use. On a T4.1 you have a lot of digital I/O pins so that's no problem at all. MCP2718FD chips should run fine at a 20MHz SPI rate. So, you should be able to have about 4 of them on a single SPI bus and still be OK. That gives you 7 total CAN buses. Anything more than that is probably a pipe dream.
 
I was wondering how many Waveshare SN65HVD230 CAN Board I can connect to teensy a 4.1 and use using the (https://github.com/tonton81/FlexCAN_T4)
library.

Previously I have used 3 of the above mentioned can boards with a teensy 4.1.

On the teensy 4.1 DOCs it says there is 3 CAN Bus. Is there nay way to extend that?

Can I use more than 3, if so how do i start.

TIA

At the risk of pointing out the obvious, CAN isn't like a UART, you can connect lots of devices to a single CAN bus.
Assuming you don't run out of data rate capacity, have issues with multiple things using the same IDs, or have things that have different fixed baud rates then there is no reason why lots of devices can't all co-exist on the same bus.
 
At the risk of pointing out the obvious, CAN isn't like a UART, you can connect lots of devices to a single CAN bus.
Assuming you don't run out of data rate capacity, have issues with multiple things using the same IDs, or have things that have different fixed baud rates then there is no reason why lots of devices can't all co-exist on the same bus.
The motors that i bought, it uses can 2.0, for my application I need the feedback, the feedback from the motor doesn't contain the sender ID only the recipient ID, so I am limited to one motor per bus. Hence looking ways to expand busses on the teensy.

Waveshare SN65HVD230 CAN Boards performs really good.

I tested CAN send and reply cycle at 2KHz, at 1M CAN baud . at those speeds, I could even run a controller with 200Hz bandwidth easily.
 
The motors that i bought, it uses can 2.0, for my application I need the feedback, the feedback from the motor doesn't contain the sender ID only the recipient ID, so I am limited to one motor per bus. Hence looking ways to expand busses on the teensy.

It would be very unusual for a CAN device to not have any flexibility on IDs.
The documentation isn't stunning but Config parameter 0x12 is CAN ID and 0x13 is Host CAN ID. Which would imply that changing those values you could get each motor to listen for commands on a different ID and send it's feedback to a different ID allowing you to differentiate between them.

If you're fine running 8 CAN busses then there is no need to do this but it does sort of defeat the whole purpose of CAN to do things that way.
 
The documentation isn't stunning but Config parameter 0x12 is CAN ID and 0x13 is Host CAN ID. Which would imply that changing those values you could get each motor to listen for commands on a different ID and send it's feedback to a different ID allowing you to differentiate between them.
@AndyA
You just blew my mind, I am definitely doing that.
From your insight, it looks like you have experience with these motors.
If that is the case, I have two unrelated questions for you.
1. Were you ever able to run those motors over serial interface?
2. Do you how one could connect to the motor using the motor wizard app and how?(The supplied usb to ttl converter didn't work, and I never could control the motors over serial either, which makes me think, the motors which I have don't work over serial at all.)
I am using GIM 8115-9 motors.

Again, I thank you form the bottom of my heart. you just saved me a lot of time and work.
 
Never heard of those motors before you mentioned the name a couple of posts ago. I googled the name and "CAN protocol documentation" and went from there. :)

But the whole reason CAN became common in automotive applications was because it reduced the number of wires needed, the cost saving on the cars wiring harness going from separate wires to a common bus was huge. Given that it would be crazy to produce a motor for any even remotely vehicle related application which didn't let you connect several to the same bus. Hence looking at the documentation because it seemed odd that there wasn't some way around this issue.
Just make sure when you initially set their command IDs you do it with only one connected at a time.

In the documents I can find the serial interface is listed as either RS485 or RS232, while they both use the same logical data format as a standard UART output they both use very different voltage levels. You would need a USB to RS232 or a far rarer USB to RS485 converter to talk to them from a computer. A standard TTL level one isn't going to work and could well be damaged if you connect it to those signals. Or you could use a USB to TTL converter and a TTL to RS232 or RS485 transceiver circuit. Given the data rate listed you would need a proper transceiver IC rather than some of the simple transistor and a resistor type converters you sometimes see that sort of just about work at low speeds.

Similarly you could connect your teensy serial port to them but you would need to go through the correct transceiver IC, connecting directly would damage the teensy.
 
I’ll spare you the details of my wrong assumptions, but anyway —
Many thanks for your help. God bless.
 
Back
Top