Baud rate self-adaption method based on input capture function of singlechip

An input capture, baud rate technology, applied in the field of serial communication, can solve the problems of high hardware environment requirements, low applicability, high baud rate waveform requirements, flexible operation, fast handshake time, and applicable scope wide effect
CN102306136AActive Publication Date: 2012-01-04NINGBO SANXING MEDICAL & ELECTRIC CO LTD

Patent Information

Authority / Receiving Office
CN ยท China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO SANXING MEDICAL & ELECTRIC CO LTD
Publication Date
2012-01-04

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a Baud rate self-adaption method based on an input capture function of a singlechip. A falling edge of a GPIO (general purpose input / output) port of the singlechip is used for triggering an interrupt function and a timer count function to capture two falling edges generated by the received data; the time between the two falling edges is counted to solve the minimal code element width; and the Baud rate of a host is determined according to the solved minimal code element width. Compared with the prior art, the method provided by the invention has the advantages that handshake time is quick, various environments are adapted, the self-adaption can be realized without sending specified data, and only one GPIO port hardware is occupied for realization. The application range is wide, operation is flexible, and the self-adaption can be realized under the condition of irregular waveforms of a serial port, thus the method can be widely applied to various embedded products which adopt a serial asynchronous communication mode.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the field of serial communication, in particular to a baud rate adaptive method based on the input capture function of a single-chip microcomputer. Background technique

[0002] RS485 communication is the same as serial port communication, sending and receiving byte data bit by bit. Although slower than byte-wise parallel communication, a serial port can send data on one wire while receiving data on the other. There is no synchronous clock line between them, which requires the sending and receiving parties to ensure that the communication rate is the same, otherwise there will be an error code. The most important parameters of serial communication are baud rate, data bits, stop bits and parity. These parameters must match for both ports to pass through. The realization of baud rate self-adaptation is to judge the uplink baud rate to adjust its own communication baud rate to realize the matching of communication rate. [000...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More