The invention discloses a
coal mine underground RS485 two-parameter self-
adaptive method, which comprises the following steps of: S1,
multiplexing a
serial port receiving pin of a
single chip microcomputer into a
timer input capture mode, and capturing original pulse width data of an RS485
bus; s2,
processing low-level pulse width data in the original pulse width data through an improved multi-stage
peak detection algorithm, and calculating to obtain the narrowest pulse width; s3, calculating the
Baud rate according to the narrowest pulse width, and verifying the effectiveness of the
Baud rate; s4, converting the original pulse width data into a digital sequence, and locking a correct check mode based on check bit identification of the digital sequence; and S5, performing data validity
verification on the
application layer, if the
verification is passed, ending the two-parameter self-adaption, and if the
verification is not passed, returning to the step S1. According to the
coal mine underground RS485 two-parameter self-adaption method, two-parameter self-adaption matching is carried out from the
Baud rate and the verification mode of the equipment, and the method has the advantages of being high in matching speed, high in precision, high in
interference resistance, good in adaptability and high in practicability.