Editing
RPI - CANOpen
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Links == https://www.autopi.io/blog/canopen-simple-introduction-explained/ https://copperhilltech.com/cangineberry-canopen-module-for-raspberry-pi/ https://www.seeedstudio.com/CAN-BUS-FD-HAT-for-Raspberry-Pi-p-4742.html?gad=1&gclid=Cj0KCQjwk96lBhDHARIsAEKO4xYAmLdGQNoTgtlQiTcZrmM7NoMeBFUGK7oMgsC-L3k_4WfpV43_WLYaAnTaEALw_wcB [https://www.autopi.io/blog/raspberry-pi-can-bus-explained/#:~:text=The%20Raspberry%20Pi%20hardware%20does,the%20CAN%20Bus%20(Raspbian). https://www.autopi.io/blog/raspberry-pi-can-bus-explained/#:~:text=The%20Raspberry%20Pi%20hardware%20does,the%20CAN%20Bus%20(Raspbian).] https://copperhilltech.com/search.php?search_query=pican3&Search= == Extenders == Various extender/repeaters or fiber media converters Bus extender: https://www.vitalsystem.com/can/canr.php Bridge: https://www.icpdas-usa.com/i_7532.html Media converter (fiber): https://moxastore.express-inc.com/ICF_1170I_M_ST_p/icf-1170i-m-st.htm Cable length verses data rate: CAN Bus Bit Rate Bus Length *1 Mbit/s 30 m *800 kbit/s 50 m *500 kbit/s 100 m *250 kbit/s 250 m *125 kbit/s 500 m *62.5 kbit/s 1000 m RS-232 *Bit Rate Bus Length *115200 bit/s 2.5 m *57600 bit/s 5.0 m *38400 bit/s 7.5 m *19200 bit/s 15 m *9600 bit/s 30 m == Config == Running a Seeed mcp2518fd based board with 2 can bus. after boot, should see the following: <code>$ dmesg | grep can</code> <code>[Β Β 11.115212] mcp251xfd spi0.1 can0: MCP2518FD rev0.0 (-RX_INT -PLL -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD o:40.00MHz c:40.00MHz m:20.00MHz rs:17.00MHz es:16.66MHz rf:17.00MHz ef:16.66MHz) successfully initialized.</code> <code>[Β Β 11.217854] mcp251xfd spi0.0 can1: MCP2518FD rev0.0 (-RX_INT -PLL -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD o:40.00MHz c:40.00MHz m:20.00MHz rs:17.00MHz es:16.66MHz rf:17.00MHz ef:16.66MHz) successfully initialized.</code> Now set the interface "up": <code>$ sudo ip link set can0 up type can bitrate 100000</code> <code>$ sudo ip link set can1 up type can bitrate 100000</code> Now testing the link with can0 connected to can1. <code>$ candump can0</code> <code>$ cansend can1 111#ff</code> == CANopen message structure == The CANopen frame contains the arbitration field (12 bits) and data fields (8 bytes)[[File:Fig1.1.png|thumb|none|upright=1.5|CANopen frame sequence]] The arbitration field contains an 11 bit identifier (COB-ID) which describes the message types. The cob-id defines the message priority, 0 is the highest, 0x7ff is the lowest. It also contains a 1 bit RTR (remote transmit request). This requests a response from the target device. [[File:Fig1.2.png|thumb|none|upright=1.5|Arbitration Fields]] NMT messages have cob-id of 0 (zero). These messages request the communication state of the node-id (data byte 2) be set to the designated state in data byte 1.[[File:Fig1.3.png|thumb|none|upright=1.5|NMT message structure]]Node Id is set on the device, can not be set via the CANopen protocols.
Summary:
Please note that all contributions to SoftwareGuy may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
SoftwareGuy:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information