Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for improving data receiving correctness of serial port

A serial port data and correctness technology, applied in the field of data transmission, can solve problems such as affecting operation, large workload of microcontroller, adverse impact, etc., to reduce workload, reduce work overhead, and improve use efficiency.

Inactive Publication Date: 2016-03-30
BEIJING TECHSHINO TECH
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] 1. The workload of the microcontroller is heavy; since the microcontroller needs to continuously enter and exit interrupts to complete the receiving work of serial port data, this makes the microcontroller constantly interrupt the current operation, keep the interrupt site, execute the interrupt processing function, Then exit the interrupt and restore the interrupted site, which makes the workload of the microcontroller very large
[0007] 2. It has adverse effects on the current operation of the microcontroller; the microcontroller needs to interrupt the current operation when processing interrupts, and frequent in and out interrupts will affect other operations, and even cause some operations to fail
For example, when a device has very strict requirements on the operation sequence, if the UART interrupt processing is frequently entered and exited during the operation of the device, the operation of the device will fail, and in severe cases, the entire program may collapse.
[0008] 3. The operating speed and operating efficiency of the software are reduced; the microcontroller frequently enters and exits the UART interrupt, which reduces the operating speed and operating efficiency of the software as a whole, because part of the work of the microcontroller is consumed to save the interrupted scene and restore the interrupted scene superior
[0009] 4. It may cause data loss and reduce the correctness of data reception; after entering the UART interrupt processing function, if the function cannot be exited in time, it will cause the newly received data of the UART interface to be read before it has time to be read. Covered by the data, the size of the UART data receiving buffer is certain (generally one or several bytes), when there is already data stored in the buffer, when the next data arrives, the UART module does not care about the current buffer. If there is no data, the new data will be directly put into the UART cache, overwriting the current data, resulting in data loss

Method used

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
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for improving data receiving correctness of serial port
  • Method and device for improving data receiving correctness of serial port
  • Method and device for improving data receiving correctness of serial port

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments.

[0040] UART (Universal Asynchronous Receiver and Transmitter) universal asynchronous transceiver (asynchronous serial communication port), is a general data communication protocol. UART uses asynchronous, serial communication.

[0041] Serial communication refers to the sequential transmission of data bit by bit using a transmission line. The feature is that the communication line is simple, and the communication can be realized by using a simple cable, which reduces the cost. It is suitable for long-distance communication, but the application of slow transmission speed.

[0042] On the one hand, the present invention provides a kind of method that improves the correctness of serial port data reception, such as Figure 4 shown, including:

[0043] St...

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

PUM

No PUM Login to View More

Abstract

The invention discloses a method and a device for improving the data receiving correctness of a serial port, and belongs to the field of data transmission. The method comprises the following steps: S101: entering a UART (Universal Asynchronous Receiver and Transmitter) interrupt processing function; S102: reading a UART cache, and saving received data in an internal memory; S103: clearing UART interruption marks; and S104, detecting UART interruption marks, and carrying out S102 when one or more UART interruption marks is / are detected. Compared with the prior art, the method has the advantages that the work load of a microcontroller is reduced; adverse impact on current operation of the microcontroller is avoided; software running speed and efficiency are improved; the correctness of received data is improved; and system power consumption is reduced.

Description

technical field [0001] The invention relates to the field of data transmission, in particular to a method and a device for improving the correctness of serial port data reception. Background technique [0002] Universal Asynchronous Receiver and Transmitter (UART) is a communication interface circuit that uses hardware to realize asynchronous serial communication. UART asynchronous serial communication interface is the most common interface in electronic circuit design, which can be used for data communication with host computer or other external devices. . Due to the generality of UART applications, most microcontrollers are integrated with UART modules. [0003] The UART module receives data in units of bytes. Every time a byte or multiple bytes are received, the UART module will set an interrupt flag. When the microcontroller enables the interrupt enable of the UART module, an interrupt will be triggered. operation, the microcontroller will interrupt the current operati...

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

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F13/42
CPCG06F13/4282G06F2213/2414Y02D10/00
Inventor 贾天亮
Owner BEIJING TECHSHINO TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products