Chain Mono UART Control Protocol (Documentation V1.0)
1. Basic Information
| Item | Description |
|---|---|
| Communication method | UART / serial port asynchronous communication |
| Device | Chain Mono |
| SKU | U217 |
| Baud Rate | 115200 bps |
| Data Bits | 8 bit |
| Stop bit | 1 bit |
| Parity | None |
| Flow Control | None |
| Document version | V1.0 |
2. Data Frame Format
All packets start with 0xAA 0x55 and end with 0x55 0xAA. Multi-byte length fields are entered low byte first.
2.1 Request Frame Format
| Field | length | Description |
|---|---|---|
| Header | 2 | Fixed to 0xAA 0x55 |
| Length | 2 | Number of bytes from Index to CRC, low byte first |
| Index | 1 | The index ID of the device in the Chain link |
| Cmd | 1 | request command code |
| Req Data | n | Request parameters; if there are no parameters, the length is 0 |
| CRC | 1 | See "3. Verification Instructions" |
| Tail | 2 | Fixed to 0x55 0xAA |
Request Frame:
AA 55 <Length_low> <Length_high> <Index> <Cmd> <Req Data...> <CRC> 55 AA 2.2 Response Frame Format
| Field | length | Description |
|---|---|---|
| Header | 2 | Fixed to 0xAA 0x55 |
| Length | 2 | Number of bytes from Index to CRC, low byte first |
| Index | 1 | The index ID of the device in the Chain link |
| Cmd | 1 | Consistent with request Cmd |
| Resp Data | n | Response data, the structure is defined by the corresponding command |
| CRC | 1 | See "3. Verification Instructions" |
| Tail | 2 | Fixed to 0x55 0xAA |
Response Frame:
AA 55 <Length_low> <Length_high> <Index> <Cmd> <Resp Data...> <CRC> 55 AA 2.3 Response Data Convention
| situation | response rules |
|---|---|
| Reply with status code | Operation_status = 0 means the operation failed, Operation_status = 1 means the operation was successful |
| Reply without status code | The judgment method of success or failure shall be based on the "Notes" of the corresponding instruction. |
3. Checksum
| Item | rules |
|---|---|
| Check field | CRC |
| Checksum range | Starting from Index, accumulate to the last byte of Data |
| Checksum algorithm | Excluding the packet header, packet trailer, Length and CRC, the remaining bytes are accumulated and the lower 8-bits are taken. |
| Empty Data | CRC = (Index + Cmd) & 0xFF |
| Checksum failure | discard the frame |
CRC = (Index + Cmd + Data[0] + ... + Data[n]) & 0xFF 3.1 Checksum Example
#include <stddef.h>
#include <stdint.h>
uint8_t chain_calc_crc(uint8_t index, uint8_t cmd,
const uint8_t *data, size_t data_len)
{
uint16_t sum = index + cmd;
for (size_t i = 0; i < data_len; i++) {
sum += data[i];
}
return (uint8_t)(sum & 0xFF);
} 4. Quick overview of commands
| Cmd | Command name | Request Length | Reply Length | Request clarification | Response description | Details |
|---|---|---|---|---|---|---|
0x10 | Set display mode | 0x0004 | 0x0004 | Index_id (device index ID), Mode (display mode) | Operation_status | 5.1 |
0x11 | Get display mode | 0x0003 | 0x0004 | Index_id (device index ID) | Mode | 5.2 |
0x30 | Set pixels | 0x0004+Num | 0x0004 | Index_id (device index ID), Num (number of pixels to be set), Draw_pixel (pixel value setting, including XY coordinates) | Operation_status | 5.3 |
0x31 | Full screen display cache refresh | 0x000B | 0x0004 | Index_id (device index ID), Display_buffer (full screen display cache) | Operation_status | 5.4 |
0x32 | Get pixel value | 0x0004+Num | 0x0003+Num | Index_id (device index ID), Num (number of pixels to be obtained), Coordinate_xy (pixel coordinates) | Pixel_state (pixel value) | 5.5 |
0x33 | Get full screen display cache | 0x0003 | 0x000B | Index_id (device index ID) | Display_buffer (full screen display buffer) | 5.6 |
0x34 | display characters | 0x0005 | 0x0004 | Index_id (device index ID), Char (ASCII code of the character to be displayed), Offset (displayed position offset) | Operation_status | 5.7 |
0x40 | Show scrolling string | 0x0007+String_length | 0x0004 | Index_id (device index ID), Scroll_mode (scrolling mode), Scroll_interval (scrolling speed), String_length (string length), char (character) | Operation_status | 5.8 |
0x41 | Get scrolling string | 0x0003 | 0x0007+String_length | Index_id (device index ID) | Scroll_mode (scrolling mode), Scroll_interval_low, Scroll_interval_high (scrolling speed), String_length (string length), char (character) | 5.9 |
0x42 | Set scroll string status | 0x0004 | 0x0004 | Index_id (device index ID), Scroll_state (scroll state) | Operation_status | 5.10 |
0x43 | Set scroll string status | 0x0003 | 0x0004 | Index_id (device index ID) | Scroll_state (scroll state) | 5.11 |
0xE0 | Set screen rotation angle | 0x0005 | 0x0004 | Index_id (device index ID), Screen_Rotation (screen rotation angle), Save_to_flash (whether to save to internal Flash) | Operation_status | 5.12 |
0xE1 | Get screen rotation angle | 0x0003 | 0x0004 | Index_id (device index ID) | Screen_Rotation (screen rotation angle) | 5.13 |
0xE2 | Set screen brightness level | 0x0005 | 0x0004 | Index_id (device index ID), Brightness_level (screen brightness level), Save_to_flash (whether to save to internal Flash) | Operation_status | 5.14 |
0xE3 | Get screen rotation angle | 0x0003 | 0x0004 | Index_id (device index ID) | Brightness_level (screen brightness level) | 5.15 |
0xE4 | clear screen | 0x0003 | 0x0004 | Index_id (device index ID) | Operation_status | 5.16 |
0xF8 | Query device unique UID | 0x0004 | 0x0004+4/12 | Index_id (device index ID), UID_Type | Operation_status、UID | 5.17 |
0xF9 | Query the upgrade program version number | 0x0003 | 0x0004 | Index_id (device index ID) | Bootloader_version | 5.18 |
0xFA | Query the device software version number | 0x0003 | 0x0004 | Index_id (device index ID) | Firmware_version | 5.19 |
0xFB | Query device type | 0x0003 | 0x0005 | Index_id (device index ID) | Device_type | 5.20 |
0xFC | Enumeration request, sent by the chain link change end device, and when the device is powered on, notifying the host to update the link device status | Device-initiated report | Device-initiated report | none | none | 5.21 |
0xFD | Heartbeat packets, regular communication between chain devices, can self-discover whether they are end devices, and the host can also use heartbeat packets to determine whether there is a chain device connected. | 0x0003 | 0x0003 | none | none | 5.22 |
0xFE | Enumerate to obtain the number of cascaded devices | 0x0004 | 0x0004 | Send_num (default 0, used to record the number of devices) | Receive_num (the value represents the number of devices) | 5.23 |
5. Command Details
5.1 Set display mode - Cmd 0x10
Request data
Input parameters: Index_id (device index ID), Mode (display mode)
Request Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x10 | Mode | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x10 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful
- Mode display mode (default 0)
0: Pixel control mode (directly set pixel display)1: Scroll character mode (scrolling display string)
5.2 Get display mode - Cmd 0x11
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x11 | CRC | 55 AA Response Data
Return parameters: Mode (display mode)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x11 | Mode | CRC | 55 AA Things to note
- Mode display mode (default 0)
0: Pixel control mode (directly set pixel display)1: Scroll character mode (scrolling display string)
5.3 Set pixels - Cmd 0x30
Request data
Input parameters: Index_id (device index ID), Num (number of pixels to be set), Draw_pixel (pixel value setting, including XY coordinates)
Request Frame:
AA 55 | 0x04 + Num | 0x00 | Index_id | 0x30 | Num | Draw_pixel0 | Draw_pixel1 | Draw_pixel2 | Draw_pixel3 | ... | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x30 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful2: Mode mismatch (needs to be configured as pixel control mode)
- Num range: 1 ~ 64
- Draw_pixel bit [7]: reserved bit [6]: Status (0=off, 1=on) bit [5:3]: X coordinate (0-7) bit [2:0]: Y coordinate (0-7)
5.4 Full-screen display cache refresh - Cmd 0x31
Request data
Input parameters: Index_id (device index ID), Display_buffer (full-screen display cache)
Request Frame:
AA 55 | 0x0B | 0x00 | Index_id | 0x31 | Display_buffer0 | Display_buffer1 | Display_buffer2 | Display_buffer3 | ... | Display_buffer7 | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x31 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful2: Mode mismatch (needs to be configured as pixel control mode)
- Display_buffer Display_buffer0 → Y: The 0th row of data Display_buffer1 → Y: The 1st row of data ... Bit7→Bit0 corresponds to X coordinate 0→7, high bit first 0=off, 1=on
5.5 Get pixel value - Cmd 0x32
Request data
Input parameters: Index_id (device index ID), Num (number of pixels to be obtained), Coordinate_xy (pixel coordinates)
Request Frame:
AA 55 | 0x04 + Num | 0x00 | Index_id | 0x32 | Num | Coordinate_xy0 | Coordinate_xy1 | Coordinate_xy2 | Coordinate_xy3 | ... | CRC | 55 AA Response Data
Return parameters: Pixel_state (pixel value)
Response Frame:
AA 55 | 0x03 + Num | 0x00 | Index_id | 0x32 | Pixel_state0 | Pixel_state1 | Pixel_state2 | Pixel_state3 | ... | CRC | 55 AA Things to note
- Coordinate_xy bit[7:6]: reserved bit[5:3]: X coordinate (0-7) bit[2:0]: Y coordinate (0-7)
- Pixel_state
0: off1: bright
5.6 Get full-screen display cache - Cmd 0x33
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x33 | CRC | 55 AA Response Data
Return parameters: Display_buffer (full screen display cache)
Response Frame:
AA 55 | 0x0B | 0x00 | Index_id | 0x33 | Display_buffer0 | Display_buffer1 | Display_buffer2 | Display_buffer3 | ... | Display_buffer7 | CRC | 55 AA Things to note
- Display_buffer Display_buffer0 → Y: The 0th row of data Display_buffer1 → Y: The 1st row of data ... Bit7→Bit0 corresponds to X coordinate 0→7, high bit first 0=off, 1=on,
5.7 Display characters - Cmd 0x34
Request data
Input parameters: Index_id (device index ID), Char (ASCII code of the character to be displayed), Offset (displayed position offset)
Request Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0x34 | Char | Offset | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x34 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful2: Mode mismatch (needs to be configured as pixel control mode)
- Char To display the ASCII code of characters, English letters, numbers and symbols with ASCII codes between 32~127 are supported, and the font size is 5x7
- Offset [7:4]: x-axis offset, 0 ~ 7 [3:0]: y-axis offset, 0 ~ 7
5.8 Display scrolling string - Cmd 0x40
Request data
Input parameters: Index_id (device index ID), Scroll_mode (scrolling mode), Scroll_interval (scrolling speed), String_length (string length), char (character)
Request Frame:
AA 55 | 0x07+String_length | 0x00 | Index_id | 0x40 | Scroll_mode | Scroll_interval_low | Scroll_interval_high | String_length | char1 | ... | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x40 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful2: Pattern mismatch (rolling character mode needs to be configured)
- Scroll_mode [7:4]: Scroll direction 0: Scroll right, 1: Scroll left, 2: Scroll up, 3: Scroll down [3:0]: Scroll mode 0: Play once and stop, 1: Scroll in a loop, 2: Bounce back and forth
- Scroll_interval Scroll_interval movement speed unit is ms/pixel, each Scroll_interval time moves one pixel Scroll_interval =( uint16_t )(( Scroll_interval_high << 8 ) | Scroll_interval_low ) Range 0~65535, unit ms/pixel
- String_length Length of rolling string
- char The displayed characters support English letters, numbers and symbols with ASCII codes between 32~127, and the font size is 5x7
5.9 Get scrolling string - Cmd 0x41
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x41 | CRC | 55 AA Response Data
Return parameters: Scroll_mode (scrolling mode), Scroll_interval_low, Scroll_interval_high (scrolling speed), String_length (string length), char (character)
Response Frame:
AA 55 | 0x07+String_length | 0x00 | Index_id | 0x41 | Scroll_mode | Scroll_interval_low | Scroll_interval_high | String_length | Char1 | ... | CRC | 55 AA Things to note
- Scroll_mode [7:4]: Scroll direction 0: Scroll right, 1: Scroll left, 2: Scroll up, 3: Scroll down [3:0]: Scroll mode 0: Play once and stop, 1: Scroll in a loop, 2: Bounce back and forth
- Scroll_interval Scroll_interval movement speed unit is ms/pixel, each Scroll_interval time moves one pixel Scroll_interval =( uint16_t )(( Scroll_interval_high << 8 ) | Scroll_interval_low ) Range 0~65535, unit ms/pixel
- String_length Length of rolling string
- Char The displayed characters support English letters, numbers and symbols with ASCII codes between 32~127, and the font size is 5x7
5.10 Set scrolling string status - Cmd 0x42
Request data
Input parameters: Index_id (device index ID), Scroll_state (scrolling state)
Request Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x42 | Scroll_state | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x42 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful2: Pattern mismatch (rolling character mode needs to be configured)
- Scroll_state
0: Start/continue scrolling1: Pause scrolling (the screen keeps the current character displayed statically)2: Stop and clear (clear the displayed characters and start from the beginning next time the setting is started)
5.11 Set scrolling string status - Cmd 0x43
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x43 | CRC | 55 AA Response Data
Return parameters: Scroll_state (scrolling state)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x43 | Scroll_state | CRC | 55 AA Things to note
- Scroll_state
0: scrolling1: suspended state2: idle/stop state
5.12 Set screen rotation angle - Cmd 0xE0
Request data
Input parameters: Index_id (device index ID), Screen_Rotation (screen rotation angle), Save_to_flash (whether to save to internal Flash)
Request Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0xE0 | Screen_Rotation | Save_to_flash | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE0 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful
- Screen_Rotation
0: Default display angle1: Rotate 90° clockwise2: Rotate 180° clockwise3: Rotate 270° clockwise (90° counterclockwise)
- Save_to_flash Whether to save internal Flash
0: Do not save1:Save
- Successful setting takes effect immediately
- Saving to the internal Flash requires erasing the page, which is a time-consuming process (about 20ms). During this period, the serial port interrupt will be turned off, and frequent operations will affect the life of the device.
5.13 Get the screen rotation angle - Cmd 0xE1
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xE1 | CRC | 55 AA Response Data
Return parameters: Screen_Rotation (screen rotation angle)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE1 | Screen_Rotation | CRC | 55 AA Things to note
- Screen_Rotation
0: Default display angle1: Rotate 90° clockwise2: Rotate 180° clockwise3: Rotate 270° clockwise (90° counterclockwise)
5.14 Set screen brightness level - Cmd 0xE2
Request data
Input parameters: Index_id (device index ID), Brightness_level (screen brightness level), Save_to_flash (whether to save to internal Flash)
Request Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0xE2 | Brightness_level | Save_to_flash | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE2 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful
- Brightness_level 0-7: 7 brightness levels, default 7
- Save_to_flash Whether to save internal Flash
0: Do not save1:Save
- Successful setting takes effect immediately
- Saving to the internal Flash requires erasing the page, which is a time-consuming process (about 20ms). During this period, the serial port interrupt will be turned off, and frequent operations will affect the life of the device.
5.15 Get the screen rotation angle - Cmd 0xE3
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xE3 | CRC | 55 AA Response Data
Return parameters: Brightness_level (screen brightness level)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE3 | Brightness_level | CRC | 55 AA Things to note
- Brightness_level 0-7: 7 brightness levels, default 7
5.16 Clear screen - Cmd 0xE4
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xE4 | CRC | 55 AA Response Data
Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE4 | Operation_status | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful
5.17 Query the unique UID of the device - Cmd 0xF8
Request data
Input parameters: Index_id (device index ID), UID_Type
Request Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xF8 | UID_Type | CRC | 55 AA Response Data
Return parameters: Operation_status, UID
Response Frame:
AA 55 | 0x04+4/12 | 0x00 | Index_id | 0xF8 | Operation_status | UID (multi-byte) | CRC | 55 AA Things to note
- Operation_status operation status
0: Operation failed1: Operation successful
- UID_Type UID type
0:4byte UID1:12byte UID
5.18 Query the upgrade program version number - Cmd 0xF9
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xF9 | CRC | 55 AA Response Data
Return parameters: Bootloader_version
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xF9 | Bootloader_version | CRC | 55 AA Things to note
None.
5.19 Query the device software version number - Cmd 0xFA
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xFA | CRC | 55 AA Response Data
Return parameters: Firmware_version
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xFA | Firmware_version | CRC | 55 AA Things to note
None.
5.20 Query device type - Cmd 0xFB
Request data
Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xFB | CRC | 55 AA Response Data
Return parameters: Device_type
Response Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0xFB | Device_type_low | Device_type_high | CRC | 55 AA Things to note
- Device_type = (uint16_t)((Device_type_high << 8) | Device_type_low)
- The device type code of Mono is 0x000D None
5.21 Enumeration request, sent by the end device of chain link change, and sent by the device when it is powered on, notifying the host to update the link device status - Cmd 0xFC
Request data
Input parameters: none
Request Frame:
Device-initiated report,No host request frame Response Data
Return parameters: none
Response Frame:
Device-initiated report,No response frame Things to note
None.
5.22 Heartbeat packet, regular communication between chain devices, you can self-discover whether it is an end device, and the host can also use the heartbeat packet to determine whether there is a chain device connection - Cmd 0xFD
Request data
Input parameters: none
Request Frame:
AA 55 | 0x03 | 0x00 | 0xFF | 0xFD | CRC | 55 AA Response Data
Return parameters: none
Response Frame:
AA 55 | 0x03 | 0x00 | 0xFF | 0xFD | CRC | 55 AA Things to note
None.
5.23 Enumerate to obtain the number of cascaded devices - Cmd 0xFE
Request data
Input parameter: Send_num (default 0, used to record the number of devices)
Request Frame:
AA 55 | 0x04 | 0x00 | 0xFF | 0xFE | Send_num | CRC | 55 AA Response Data
Return parameter: Receive_num (the value represents the number of devices)
Response Frame:
AA 55 | 0x04 | 0x00 | 0xFF | 0xFE | Receive_num | CRC | 55 AA Things to note
None.
6. Status code/enumeration value
6.1 Operating status
| value | Name | Description |
|---|---|---|
0 | Failure | Operation failed |
1 | Success | Operation successful |
Other modes, ranges, and event enumeration values are defined in the "Notes" of the corresponding instructions.
7. Version records
| Document version | Date | Description |
|---|---|---|
V1.0 | 2026-1-19 | Organized according to the official Chain Mono protocol |