Sep . 2025
The key to effective communication with the module is to correctly implement its serial control protocol. This protocol uses a binary frame format, and all parameter configuration and status queries are accomplished by sending and receiving specific data frames. Each data frame follows a fixed structure, consisting of a header, command, data, and tail, among other parts. Table 3: Serial Protocol Frame Structure According to the protocol document, the checksum is calculated as follows: each pair of bytes in the data to be checked is formed into a 16-bit number and then added sequentially. If the data frame has an odd length, 0x00 is appended to the last byte. The carry-over part (exceeding 16 bits) from the accumulation process is added back to the lower 16 bits of the result until the sum is less than or equal to 0xFFFF. Finally, the resulting 16-bit number is XORed with 0xFFFF to get the final checksum. The reference C code provided in the protocol document is as follows: uint16_t PcCheckSum(uint8_t *buf, int16_t len) { A noteworthy engineering detail is that the protocol document mentions that if the user does not want to calculate the checksum, the CKSUM field can be sent as 0x0000, and the module will ignore the checksum process. This can be very useful during the initial debugging phase, but for the sake of communication reliability, the correct checksum should be implemented and used in the final product. The following table categorizes and organizes all the commands supported by the module, providing a more structured reference than the original documentation. Table 4: DMR858M Command Code (CMD) Complete ReferenceFrame Structure Analysis


Checksum Calculation Method
uint32_t sum = 0;
while (len > 1) {
sum += 0xFFFF & ((*buf << 8) | *(buf + 1));
buf += 2;
len -= 2;
}
if (len) {
sum += (0xFF & *buf) << 8;
}
while (sum >> 16) {
sum = (sum & 0xFFFF) + (sum >> 16);
}
return ((uint16_t)sum ^ 0xFFFF);
}
Complete Command Set Reference
Part 1: In-depth Analysis of the DMR858M Module
Part 2: Hardware Integration and Reference Design
Part 3: Deconstructing the Serial Control Protocol
Part 4: Firmware Development and Driver Design
Part 5: Exploring Advanced Features and Conclusion
+86-755-23080616
sales@nicerf.com
Website: https://www.nicerf.com/
Address: 309-315, 3/F, Bldg A, Hongdu business building, Zone 43, Baoan Dist, Shenzhen, China
Privacy Policy
· Privacy Policy
There is currently no content available
Email:sales@nicerf.com
Tel:+86-755-23080616