|
|
|
CANPIC
|
CANPIC CAN232 - Binary Commands Binary Commands allows an application to interface to the CANPIC CAN232 adapter using 8-bit binary commands. This can decrease the number of characters (or bytes) that are required to execute a particular command. The following table lists the available binary commands and the format in which to use them. The commands are further explained in individual sections that follows.
Read CAN Register - E0 This command reads one of the CAN registers. Register address is offset from 0xf00. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Write Register - E1 This command writes one of the CAN registers. Register is offset from 0xf00. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Read Message Data Byte - E2 This command reads one of the message objects data bytes. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Write Message Data Byte - E3 This command writes one of the message objects data bytes. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Set Baud Rate - E7 This command sets the baud rate. See above table in ASCII command for setting baud rate for values. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Get Baud Rate - E8 This command gets the baud rate index. See above table in ASCII command for baud rate for values. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Configure Message Object - E9 This command configures the message object. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Read Message Object - EA This command reads the message configuration. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Set Message Send Time - EB This command sets the message send time for a message object. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
This command reads the message send time for a message object. Format of command from host to CANPIC CAN232;
Data returned from CANPIC CAN232;
Send/Receive Message Send Time - C0 to D2 Once a message object is configured as either a trasnmit or receive type message, a single byte command (C0 to D2) will trigger it to transmit or return the latest received values. For example, if message object 5 is configure as a transmit message, a C5 command will set the message to transmit. Conversely, if the message object 3 is a receive message, a C3 command will return the contents of the message. Format of command from host to CANPIC CAN232; 1. Command(hex) C0 to D2 Data returned from CANPIC CAN232 will depend on the message configuration. An invalid message (one that is not configured) will return 0. Transmit Message 1. Message type 1 Receive Message 1. Message Type: 2 2. Address ID Type: 0=11 bit, 1= 29 bit
|
|
Copyright © 2002 Embedded Micro Software | Site Map | Contact Us |