Difference between revisions of "CAN Protocol"
Alexalspach (Talk | contribs) (→ID (Message Identifier)) |
Alexalspach (Talk | contribs) (→Case-study: Softing CAN) |
||
Line 35: | Line 35: | ||
==Case-study: Softing CAN== | ==Case-study: Softing CAN== | ||
+ | In this chapter, sample code demonstrating the implementation of the CAN communication interface is provide. This is the foundation for Softing PCI CAN. | ||
===Opening the CAN Communication Channel=== | ===Opening the CAN Communication Channel=== | ||
===CAN Initialization=== | ===CAN Initialization=== |
Revision as of 21:17, 5 October 2012
Contents |
CAN Communication
Baud-Rate
The CAN communication baud-rate is 1Mbps.
Non-Periodic Communication
Messages can be sent to initialize or stop CAN communication.
Periodic Communication
The Allegro Hand control software attempts to communicate with the real or simulated hand at a regular control interval. Every 3 milliseconds the joint torques are calculated and the joint angles are updated.
CAN Frames
Standard CAN Packet
The standard CAN packet used for communication contains 8 bytes.
typedef struct{ unsigned char STD_EXT; unsigned long msg_id; //message identifier unsigned char data_length; // char data[8]; // data array } can_msg;
ID (Message Identifier)
The 4 byte integer CAN message is split into the command ID (26 bits), destination ID (3bits) and source ID (3 bits).
TABLE GOES HERE
Command Identifiers
TABLE GOES HERE
Source and Destination Identifiers
TABLE GOES HERE
Case-study: Softing CAN
In this chapter, sample code demonstrating the implementation of the CAN communication interface is provide. This is the foundation for Softing PCI CAN.
Opening the CAN Communication Channel
CAN Initialization
Starting Periodic CAN Communication
Stopping Periodic CAN Communication
Transmitting Control Torques
Receiving Joint Angles
Whos here now: Members 0 Guests 0 Bots & Crawlers 1 |