30
8 Serial Port Instruction
Users can settle the module by sending instruction from mainframe.
Please make sure communicate parameter complete matching between module and mainframe.
Module default serial communicate parameter: Baud rate 9600bps; No check; 8 bit data; 1 bit stop
8.1CRC Algorithm
CRC: CRC_CCITT check value (2 bytes).
Suitable for Types、Lens、Address、Datas;
Characteristic polynomial : X16+X12+X5+1, multinomial coefficient: 0x1021, original value:0 ;
For single byte, the highest bit will be calculated at first, output will be without negation.
unsigned int crc_cal_by_bit(unsigned char* ptr, unsigned int len)
for(unsigned char i = 0x80; i != 0; i /= 2)