SLCAN Protocol Command Guide

Last revision 2026/01/14

The SLCAN Protocol Command Guide provides detailed instructions on utilizing the SLCAN protocol for simplifying CAN communication, including enabling/disabling communication, sending various types of data frames, setting baud rates, and retrieving system information. The guide emphasizes the ease of using serial commands to achieve complex CAN operations, making it accessible for users to integrate and operate within their systems.

This module adopts the SLCAN protocol, integrating it into the MCU. Serial commands can be used to transmit data or make corresponding configurations. Additionally, communication with a PC supporting the SLCAN protocol is also possible.

By utilizing the SLCAN protocol, you can spare yourself from the complexities of the underlying CAN protocol. Achieving CAN communication is as simple as sending serial commands. Below, we will delve into the purposes and usage of each instruction within the SLCAN protocol.

Note: AT commands are case-sensitive.

9.1 Enable or disable CAN communication

O = Activate CAN communication

C = Deactivate CAN communication

Command description: Use the commands "O" and "C" to enable or disable CAN communication, following the same method as before. If "HEXShow" is selected, the system will respond with 0D, indicating successful command execution. A response of 07 indicates an incorrect instruction.

Enable or disable CAN

9.2 Sending CAN data

t = Send 11-bit standard data frame

r = Send 11-bit standard RTR data frame

T = Send 29-bit extended data frame

R = Send 29-bit extended RTR data frame

Z0 = Data frame without timestamp

Z1 = Data frame with timestamp

Command description

The SLCAN protocol allows for the transmission of 11-bit standard data frames and 29-bit extended data frames. The only difference between CAN standard data frames and extended data frames is the length of the frame ID, enabling the connection of more CAN nodes.

When sending data, adhere to the frame length specifications in the SLCAN protocol. The ASCII representation of an SLCAN frame is as follows:

type: Indicates the type of data frame to be sent.

id: For standard data frames, the ID is represented by 3 bytes of ASCII Hex. For extended data frames, it is represented by 8 bytes of ASCII Hex.

dlc: A single-byte number (0-8) that describes the number of hexadecimal data to be sent.

data: The data to be sent in ASCII representation of hexadecimal, with a quantity corresponding to dlc.

Example

Send 11-bit standard data frame: t123178 - CAN ID: 0x123, CAN DLC: 1, Data: 0x78

Send 11-bit standard data frame: t4563112233 - CAN ID: 0x456, CAN DLC: 3, Data: 0x11 0x22 0x33

Send 29-bit extended data frame: T12ABCDEF2AA55 - Extended CAN ID: 0x12ABCDEF, CAN DLC: 2, Data: 0xAA 0x55

Send 11-bit standard RTR data frame: r1230 - CAN ID: 0x123, CAN DLC: 0, No data, Remote Transmission Request.

Note: Due to memory constraints, extended frames are limited to sending and receiving data of lengths equal to or below 6 bytes. Should you wish to transmit data exceeding 6 bytes, it is recommended to divide it into multiple frames for transmission.

9.3 CAN Communication Rate Setting

S1 = Set CAN communication rate to 25 kbits/s

S2 = Set CAN communication rate to 50 kbits/s

S3 = Set CAN communication rate to 100 kbits/s

S4 = Set CAN communication rate to 125 kbits/s

S5 = Set CAN communication rate to 250 kbits/s

S6 = Set CAN communication rate to 500 kbits/s (default configuration)

S7 = Set CAN communication rate to 800 kbits/s

S8 = Set CAN communication rate to 1 Mbits/s

Command description

The S1 to S8 commands are used to set the baud rate for CAN communication. In a CAN bus, all nodes must have consistent baud rates to communicate with each other.

Using the "h" command, you can query the current module's baud rate and the status of CAN communication being open or closed. Note that this sets the communication baud rate for the CAN bus, not the UART baud rate. The default baud rate for the UART interface is 115200.

9.4 Information Retrieval

V = Get current version

h = Get help information

Command description

Send "V" to retrieve firmware version information. After a successful transmission, the response will contain the version number. Send "h" to get help information, which will provide instructions for all commands as well as the current CAN baud rate and status.

Was this article helpful?

TOP