AT32F425-Evaluation Report-CANOpen Porting 05
[Copy link]
Brief description
This series is based on the evaluation report of the Ateli-AT32F425R8T7-7 development board
Target:
> Transplant CANOpen protocol
Brief description:
CANopen is a high-level communication protocol based on the Controller Area Network ( CAN ). It includes communication sub-protocols and device sub-protocols and is often used in embedded systems . It is also a fieldbus commonly used in industrial control .
CANopen implements the protocols above (including) the network layer in the OSI model. The CANopen standard includes an addressing scheme, several small communication sub-protocols, and an application layer defined by a device sub-protocol . CANopen supports network management, device monitoring, and communication between nodes , including a simple transport layer that handles segmented data transmission and its combination. Generally, the data link layer and the physical layer are implemented using CAN. In addition to CANopen, there are other communication protocols (such as EtherCAT ) that implement
Tutorial:
CANOpen Tutorial Series | EmbeddedDevelop (strongerhuang.com)
NOTE: I also transplanted according to the above tutorial, the article is very well written
The code after porting is as follows:
Heartbeat message sending status
According to the above tutorial, after the code is transplanted, there will be a heartbeat message effect
Data analysis
Intercept a data frame:
Sequence number Transmission direction Timestamp ID Frame format Frame type Length Data
0 Receive 18:14:51.977.0 0x00000702 Data frame Standard frame 1 05
The above is one of the heartbeat messages, from which we can conclude:
Heartbeat message COB-ID: 0x0x00000702
Data type: Standard frame
Data length: 1
Data content: 0x05
Theoretical analysis
To know the meaning of the message, of course we have to look at the document. From the above figure, we can see that COB-ID is composed of 1792 (0x700) + Node-ID of CANOpen device.
I wrote node-id as 2 in the program, so the cob-id of the heartbeat can be seen in the message as 0x700+0x02
The data content 0x05 indicates that the current device status is Operational, which means that the entire protocol is normal and the device can communicate normally.
|