Difference between revisions of "HANcoder/Training Material/CAN Communication"

From OpenMBD
Jump to: navigation, search
(Created page with "{{HANcoder}} == Description == This example shows how to use the CAN blocks. As an example the E407 is used as a gateway between two CAN busses. Data received on the first C...")
 
Line 3: Line 3:
  
 
== Description ==
 
== Description ==
This example shows how to use the CAN blocks. As an example the E407 is used as a gateway between two CAN busses. Data received on the first CAN bus is send on the second CAN bus and vice versa.
+
This example model shows how to use the CAN receive, CAN send, CAN config and XCP on CAN config blocks.  
 
+
The model sends two CAN messages, one message with a standard identifier of 0x12 sending four uint16's and sending the Most Significant Byte first, the other message sends the same data but with an extended identifier of 0x000012 and the Least Significant Byte first.
The first CANbus has a baudrate of 500kbit/s and is
+
Also two CAN messages are received, one with standard and one with extended identifier. The data that is being received in these messages is of type uint8. The 'CAN config' block is used to enable the CAN peripheral of the micro controller and the 'XCP on CAN config' block is used to enable communication with HANtune over the CANbus.

Revision as of 12:24, 14 April 2017



Description

This example model shows how to use the CAN receive, CAN send, CAN config and XCP on CAN config blocks. The model sends two CAN messages, one message with a standard identifier of 0x12 sending four uint16's and sending the Most Significant Byte first, the other message sends the same data but with an extended identifier of 0x000012 and the Least Significant Byte first. Also two CAN messages are received, one with standard and one with extended identifier. The data that is being received in these messages is of type uint8. The 'CAN config' block is used to enable the CAN peripheral of the micro controller and the 'XCP on CAN config' block is used to enable communication with HANtune over the CANbus.