libcanard on arduino (MCP2515)

334 views
Skip to first unread message

lonox

unread,
Feb 6, 2018, 9:27:31 AM2/6/18
to UAVCAN
I am trying to use UAVCAN libcanard with an arduino and the mcp2515 chip. (which should be supported by the avr library)

Still porting the demo example from the test folder.

Do you have any suggestions?

Do you foresee any problems why such an attempt might fail anyway?

Are there other examples beside the demo in the test folder?

many thanks,
olaf

Iain Galloway

unread,
Feb 7, 2018, 12:21:28 AM2/7/18
to UAVCAN
Would you be interested in using the FlexCAN interface that is built into the Teensy 3.2 board?
It still needs a CAN PHY but at least it's IP built into the processor. Looks like there is activity out there.

Regards
-iain

Iain Galloway

unread,
Feb 7, 2018, 12:29:55 AM2/7/18
to UAVCAN

Pavel Kirienko

unread,
Feb 7, 2018, 3:01:19 AM2/7/18
to lonox, UAVCAN
Hi Olaf,

As I replied in an adjacent thread, there's not much in the way of examples right now. Please see https://groups.google.com/forum/#!topic/uavcan/7-gmF42vQT0

Pavel.

--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+unsubscribe@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uavcan/f846c70e-6ab7-4ca2-b805-1b5c7ee268c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lonox

unread,
Feb 8, 2018, 2:41:48 AM2/8/18
to UAVCAN


On Wednesday, February 7, 2018 at 1:21:28 PM UTC+8, Iain Galloway wrote:
Would you be interested in using the FlexCAN interface that is built into the Teensy 3.2 board?

I will have a look at your link. I guess you suggest it because it will be less work to transfer it to arduino than UAVCANARD?
 
It still needs a CAN PHY but at least it's IP built into the processor. Looks like there is activity out there.

 
What is a CAN PHY?

bernha...@googlemail.com

unread,
Feb 8, 2018, 4:43:31 AM2/8/18
to UAVCAN
Hi Olaf,

My first sensor i used was an Arduino for a simple sensor.
But i can cancel it with Arduino because it was to slow on the can bus side.
Now i use a STM8.

Regards

Bernhard

Iain Galloway

unread,
Feb 8, 2018, 12:54:54 PM2/8/18
to lonox, UAVCAN
Hi Lonox
I should explain more.
I am still talking about UAVCANARD on an Ardunio board.
BUT - use hardware (Teensy 3.2 or 3.6) which has the CAN interface built into the part.
For CAN you still need a PHY. A PHY is the physical layerr interface or electrical signalling component.
The PHY interfaces the correct currents and voltages for typical CAN.

This is the same idea as a UART (3V or 5V logic level) vs a physical interface like RS232 (actually specified at 15V)

 Hopefully i made this clearer?

I just noticed that some people were aleady working with Teensy and CAN. 
Since the CAN is internal to the Teensy it might be easier to work with and certainly better performance.

Regards
-iain




--
You received this message because you are subscribed to a topic in the Google Groups "UAVCAN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/uavcan/AyzkKKK32bM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to uavcan+unsubscribe@googlegroups.com.

To post to this group, send email to uav...@googlegroups.com.

lonox

unread,
Feb 12, 2018, 11:58:23 PM2/12/18
to UAVCAN
Ah thanks for the clarification
I set up already a can network between three arduino's using MCP5215 and a transceiver (what you call PHY).
Actually it seem to work well, that is why I looked into application layer solutions and came here.
Unluckily now it stopped working and I first have to debug the physical parts before I can look again if I can get LIBCANARD working on arduino.
I hope to come back to this soon.



On Friday, February 9, 2018 at 1:54:54 AM UTC+8, Iain Galloway wrote:
Hi Lonox
I should explain more.
I am still talking about UAVCANARD on an Ardunio board.
BUT - use hardware (Teensy 3.2 or 3.6) which has the CAN interface built into the part.
For CAN you still need a PHY. A PHY is the physical layerr interface or electrical signalling component.
The PHY interfaces the correct currents and voltages for typical CAN.

This is the same idea as a UART (3V or 5V logic level) vs a physical interface like RS232 (actually specified at 15V)

 Hopefully i made this clearer?

I just noticed that some people were aleady working with Teensy and CAN. 
Since the CAN is internal to the Teensy it might be easier to work with and certainly better performance.

Regards
-iain


On Thu, Feb 8, 2018 at 1:41 AM, lonox <ohoch...@gapps.cityu.edu.hk> wrote:


On Wednesday, February 7, 2018 at 1:21:28 PM UTC+8, Iain Galloway wrote:
Would you be interested in using the FlexCAN interface that is built into the Teensy 3.2 board?

I will have a look at your link. I guess you suggest it because it will be less work to transfer it to arduino than UAVCANARD?
 
It still needs a CAN PHY but at least it's IP built into the processor. Looks like there is activity out there.

 
What is a CAN PHY?

--
You received this message because you are subscribed to a topic in the Google Groups "UAVCAN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/uavcan/AyzkKKK32bM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to uavcan+un...@googlegroups.com.

To post to this group, send email to uav...@googlegroups.com.

lonox

unread,
Feb 13, 2018, 10:58:40 AM2/13/18
to UAVCAN
OK I got the some basics running with two arduinos (+MCP2515+MCP2551) i adapted the demo file for the avr driver. and i see on the second arduino which is just printing the incoming messages the message which is send as a id request.

I am wondering now if libcanard implemented a specific function to identify a id request message as such and return an id request?

Pavel Kirienko

unread,
Feb 13, 2018, 11:01:03 AM2/13/18
to lonox, UAVCAN
Hello,

Things are progressing, cool! Could you please clarify what do you mean by "ID request"?

Pavel.

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

To post to this group, send email to uav...@googlegroups.com.

Pavel Kirienko

unread,
Feb 13, 2018, 11:50:21 AM2/13/18
to Olaf Thorsten HOCHHERZ, uav...@googlegroups.com
Yes. Libuavcan is designed with extremely resource-constrained systems in mind, such as 8-bit AVR MCU.

On Tue, Feb 13, 2018 at 6:47 PM, Olaf Thorsten HOCHHERZ <ohoch...@gapps.cityu.edu.hk> wrote:
will libuavcan compile on arduinos? and behave reasonable - i mean fast enough?

On Wed, Feb 14, 2018 at 12:28 AM, Pavel Kirienko <pavel.k...@gmail.com> wrote:
Nope, it doesn't. Libcanard is a tough library for tough people - you are provided with the bare transport layer, and everything on top of it has to be coded up manually.

If you want a higher-level approach with a convenient, highly abstract API, consider using libuavcan.

Pavel.

On Tue, Feb 13, 2018 at 6:25 PM, Olaf Thorsten HOCHHERZ <ohoch...@gapps.cityu.edu.hk> wrote:
ah i mean that in the "Dynamic node ID allocation" I see on the monitoring device recurring messages in the following form

Extended ID: 0x18974D00  DLC: 8  Data: 0x01 0x00 0x01 0x02 0x03 0x04 0x05 0xC0

(only the last byte of the data array is changing (from 0xC0 to 0xDF))

It seems to me that it can be only the broadcasted message to request a node ID.

My question should have been If libcanard contains a function which helps with the dynamic node ID allocation

Never Mind

unread,
Feb 16, 2018, 6:45:36 AM2/16/18
to UAVCAN
Hi! I am glad to say that there are some more UAVCAN tutorials available now. They are all based on Zubax BABEL hardware and LIBCANARD software, but maybe you will find it useful. Please check it here 
Reply all
Reply to author
Forward
0 new messages