Method for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation

A communication interface and software simulation technology, which is applied in the direction of electrical components, electrical digital data processing, transmission systems, etc., can solve the problems of consuming system resources, failing to achieve full-duplex data sending and receiving communication mode, and acquisition misalignment, so as to reduce system resources The effect of loss, improvement of product competitiveness, and reduction of product cost

Active Publication Date: 2012-07-04
XIAMEN YAXON NETWORKS CO LTD
View PDF4 Cites 22 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, there are many shortcomings in its implementation method. 1. The method of judging the start bit of the data is to use the interrupt timing sampling monitoring method. The interrupt timing interval is 1 / 3 of the baud rate timing interval, and the received data is received at a baud rate of 3 times. Carry out sampling monitoring, which leads to too frequent timer interrupts, and in the case of no data transmission and reception, it is also necessary to regularly sample and monitor whether there is data in the communication bus, which consumes system resources; 2. The bit data sampled each time is the end position of the collected bit , the error tolerance of data reception is poor, and the accuracy rate is low, because when the timer precision is low or the bit data width error sent by the other party is large, there will be errors in the received data due to collection errors; 3. According to the description of the scheme, when sending For data, divide the timing by 3, and the interrupt timing interval is equal to the baud rate interval, so that one bit is sent for each timing interrupt, so it can be seen that in the process of sending data, the timing frequency cannot be 3 times the baud rate. The receiving data is sampled and monitored, and the data reception cannot be realized. Therefore, the full-duplex data sending and receiving communication mode cannot be achieved; 4. When simulating multiple UART communication interfaces and the baud rates of each communication interface are different, each communication interface needs to have a Timers, it is impossible to share a timer with multiple UART communication interfaces, so the number of UART communication interfaces that can be simulated is limited by the number of timers in the microprocessor, and usually the number of timers in the microprocessor is Relatively few; 5. When a byte of data is received, the received data is stored in the receiving FIFO queue in the timer interrupt service routine, which will cause the execution time of the timer interrupt service routine to be too long and reduce the accuracy of the system. Reduce the maximum supported communication baud rate

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 for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation
  • Method for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation
  • Method for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0043] The present invention will be further described in conjunction with the accompanying drawings and specific embodiments.

[0044] The method of the invention simulates a UART communication interface and only needs one timer, two I / O ports and one software interrupt. Simulating multiple UART communication interfaces can share a timer and a software interrupt. Therefore, every time a UART communication interface is expanded, only 2 I / O ports need to be added.

[0045] Among them, the role of the timer is to use the timer timing interrupt function to provide accurate baud rate timing. Considering that multiple UART communication interfaces share a timer and the communication baud rate may be different, the timing interval of the timer (T_TIMER) is set to the bit duration of the highest baud rate among multiple UART communication interfaces 1 / 2. The timer interrupt frequency (F_TIMER) is only twice the maximum baud rate, reducing the timer interrupt frequency and reducing ...

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 relates to a processing method for transmitting and receiving UART (universal asynchronous receiver/transmitter) communication interface data through software simulation in an embedded system. The method for achieving a plurality of UART communication interfaces through software simulation, provided in the invention, comprises a data receiving method and a data transmitting method, wherein baud rate timing is accurately achieved by a timer interruption function of a timer, and both transmitting and receiving are performed under the control of timer interruption. In the invention, for simulating one UART communication interface, only one timer, two I/O (input/output) ports and one software interrupt are required. For simulating a plurality of UART communication interfaces, the timer and the software interrupt are shared. Therefore, once one UART communication interface is added and expanded, only two I/O ports are required to be added. According to the invention, UART communication interfaces can be achieved through software simulation.

Description

technical field [0001] The invention relates to a method for realizing UART communication through software simulation, in particular to a processing method for realizing the sending and receiving of UART communication interface data through software simulation in an embedded system. Background technique [0002] With the development of embedded technology and the diversification of embedded devices, the multi-computer system composed of embedded devices has made great progress. The serial port UART (Universal Asynchronous Receiver / Transmitter, universal asynchronous Receiver and transmitter) for data transmission, forming a complex master-slave communication network. [0003] In practical applications, it is often encountered that a master device needs to be connected to various slave devices at the same time, and the communication method between the master device and the slave device often uses the UART communication interface, which can only communicate one-to-one. Multip...

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
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/10G06F13/24
Inventor 叶德焰赖荣东陈挺李基勇陈余菲
Owner XIAMEN YAXON NETWORKS CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products