CN103488595A - Data transmission method capable of ensuring small capacity cache serial communication safety - Google Patents
Data transmission method capable of ensuring small capacity cache serial communication safety Download PDFInfo
- Publication number
- CN103488595A CN103488595A CN201310371637.7A CN201310371637A CN103488595A CN 103488595 A CN103488595 A CN 103488595A CN 201310371637 A CN201310371637 A CN 201310371637A CN 103488595 A CN103488595 A CN 103488595A
- Authority
- CN
- China
- Prior art keywords
- capacity
- buffer memory
- data
- fifo
- data transmission
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 89
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000006854 communication Effects 0.000 title claims abstract description 39
- 238000004891 communication Methods 0.000 title claims abstract description 38
- 239000000872 buffer Substances 0.000 claims description 54
- 238000012546 transfer Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 6
- 238000013461 design Methods 0.000 abstract description 4
- 238000009825 accumulation Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 239000012464 large buffer Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Landscapes
- Communication Control (AREA)
- Information Transfer Systems (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明涉及一种保证小容量缓存串口通讯安全性的数据传输方法,首先给出了缓存FIFO的容量N,单字节的数据传输时间T以及最大中断时间T中断之间的关系,在不同的数据传输时刻判断缓存FIFO的工作状态,根据缓存FIFO不同状态采取不同的传输策略,从而保证了串口通讯的可靠性和连续性,防止中断打断对数据传输的影响,本发明数据传输方法根据缓存FIFO容量、单字节的数据传输时间、最大中断处理时间等固有特性设计,同时适用与大容量FIFO与小容量FIFO,尤其适用于容量≤10字节的小容量FIFO;且本发明方法实现过程简单、易于实现,具有较强的实用性。
The present invention relates to a data transmission method that guarantees the safety of small-capacity cached serial port communication. Firstly, the relationship between the capacity N of the cached FIFO, the single-byte data transmission time T and the maximum interrupted time T interrupt is given. In different Judging the working state of the cache FIFO at the moment of data transmission, adopting different transmission strategies according to the different states of the cache FIFO, thereby ensuring the reliability and continuity of serial communication and preventing interruptions from affecting data transmission. The data transmission method of the present invention is based on the cache FIFO capacity, single-byte data transmission time, maximum interrupt processing time and other inherent characteristic designs are applicable to large-capacity FIFO and small-capacity FIFO at the same time, especially suitable for small-capacity FIFOs with a capacity of ≤10 bytes; and the realization process of the method of the present invention It is simple, easy to implement, and has strong practicability.
Description
技术领域technical field
本发明涉及一种保证小容量缓存串口通讯安全性的数据传输方法,属于串口通讯领域。The invention relates to a data transmission method for ensuring the safety of small-capacity buffered serial port communication, belonging to the field of serial port communication.
背景技术Background technique
串口通讯是嵌入式系统普遍采用的一种通讯方式,保证通讯的实时性、正确性是通讯逻辑设计需要关注的重点。在嵌入式系统中,中断是威胁串口正常通讯的重要因素,为防止外部中断对串口通讯的影响,目前业内多从硬件资源入手,采用大容量的缓存(FIFO)保证数据传输的连续性。在具备大容量缓存的情况下,软件可每次向缓存一次性写入足够量的数据,通过使能传送状态机使之从发送FIFO中读取数据传送到移位寄存器,移位寄存器通过FSM完成数据的输出。这样,即便软件的某一发送过程被中断打断,由于发送FIFO中有足够的数据,中断过程不会影响传送状态机的正常传输工作,从而保证了数据传输的实时性和连续性。然而,采用大容量缓存需要增加外围电路和芯片,这无疑增加了系统的复杂度和成本。此外若采用传统大缓存的通讯方式一次性将FIFO填满,由于仍存在尚未发完的数据,在两次写数的过程之间仍有可能无法避免中断的打断。此外特别是针对小容量的缓存,数据传输过程中打断的概率更加频繁,一旦中断打断,无法保证数据传输的连续性。Serial port communication is a communication method commonly used in embedded systems. Ensuring the real-time and correctness of communication is the focus of communication logic design. In the embedded system, interruption is an important factor that threatens the normal communication of the serial port. In order to prevent the impact of external interruption on the communication of the serial port, the industry starts with hardware resources and adopts a large-capacity buffer (FIFO) to ensure the continuity of data transmission. In the case of a large-capacity cache, the software can write a sufficient amount of data to the cache each time, by enabling the transmission state machine to read the data from the transmit FIFO and transmit it to the shift register, and the shift register passes through the FSM Complete data output. In this way, even if a sending process of the software is interrupted by an interruption, since there is enough data in the sending FIFO, the interruption process will not affect the normal transmission work of the transmission state machine, thereby ensuring the real-time and continuity of data transmission. However, the use of large-capacity cache requires additional peripheral circuits and chips, which undoubtedly increases the complexity and cost of the system. In addition, if the traditional large buffer communication method is used to fill up the FIFO at one time, because there are still unsent data, there may still be unavoidable interruptions between the two writing processes. In addition, especially for small-capacity caches, the probability of interruption during data transmission is more frequent. Once interrupted, the continuity of data transmission cannot be guaranteed.
发明内容Contents of the invention
本发明的目的在于克服现有技术的上述缺陷,提供一种保证小容量缓存串口通讯安全性的数据传输方法,该方法能够有效保证数据传输的连续性,防止中断打断对数据传输的影响,该方法同时适用于大容量缓存FIFO与小容量缓存FIFO,尤其适用于容量≤10字节的小容量缓存FIFO。The purpose of the present invention is to overcome the above-mentioned defects of the prior art, and provide a data transmission method that ensures the security of small-capacity buffered serial port communication. The method can effectively ensure the continuity of data transmission and prevent interruptions from affecting data transmission. The method is applicable to large-capacity buffer FIFO and small-capacity buffer FIFO at the same time, and is especially suitable for small-capacity buffer FIFO with a capacity of ≤10 bytes.
本发明的上述目的主要是通过如下技术方案予以实现的:Above-mentioned purpose of the present invention is mainly achieved through the following technical solutions:
一种保证小容量缓存串口通讯安全性的数据传输方法,所述串口为上位机与下位机的接口,串口包括缓存FIFO、传送状态机和移位寄存器,其特征在于:所述缓存FIFO的容量为N,单字节的数据传输时间为T,最大中断时间为T中断,满足:其中ε为温度损耗系数,具体实现方法如下:A data transmission method that guarantees the security of small-capacity buffer serial port communication, the serial port is the interface between the upper computer and the lower computer, and the serial port includes a buffer FIFO, a transmission state machine and a shift register, and is characterized in that: the capacity of the buffer FIFO is N, the data transmission time of a single byte is T, and the maximum interrupt time is T interrupt , satisfying: Where ε is the temperature loss coefficient, and the specific implementation method is as follows:
(1)、上位机对串口进行初始化,完成串口工作状态配置;(1) The upper computer initializes the serial port and completes the configuration of the working state of the serial port;
(2)、上位机向传送状态机发送控制指令,传送状态机根据所述控制指令停止数据传输;(2) The upper computer sends a control command to the transmission state machine, and the transmission state machine stops data transmission according to the control command;
(3)、上位机将数据写入缓存FIFO,写入的数据个数小于或等于缓存FIFO的容量N,同时上位机向传送输状态机发出控制指令;(3) The upper computer writes data into the cache FIFO, and the number of written data is less than or equal to the capacity N of the cache FIFO, and at the same time, the upper computer sends a control command to the transmission state machine;
(4)、传送状态机根据所述控制指令从缓存FIFO中读取数据并传送到移位寄存器,移位寄存器将所述数据输出给下位机;(4) The transmission state machine reads data from the cache FIFO according to the control instruction and transmits it to the shift register, and the shift register outputs the data to the lower computer;
(5)、上位机判断缓存FIFO的状态,若缓存FIFO容量已满,则等待,若缓存FIFO容量未满,则进入步骤(6);(5) The host computer judges the state of the cache FIFO, if the cache FIFO capacity is full, then wait, if the cache FIFO capacity is not full, then enter step (6);
(6)、若缓存FIFO中已使用容量≥2字节,则上位机向缓存FIFO中未使用容量写入数据,进入步骤(7);若缓存FIFO中已使用容量<2字节,则上位机停止向缓存FIFO中写入数据,待传送状态机将缓存FIFO中的数据取空后,进入步骤(7);(6) If the used capacity in the cache FIFO is ≥ 2 bytes, then the host computer writes data to the unused capacity in the cache FIFO, and enters step (7); if the used capacity in the cache FIFO is < 2 bytes, then the host computer The machine stops writing data into the cache FIFO, and after the data in the cache FIFO is emptied by the transmission state machine, enter step (7);
(7)、上位机判断数据是否发完,若已发完,结束数据发送;若未发完,则进入步骤(2)。(7). The host computer judges whether the data has been sent, if it has been sent, end the data transmission; if not, go to step (2).
在上述保证小容量缓存串口通讯安全性的数据传输方法中,步骤(1)中上位机对串口进行初始化,完成串口工作状态配置包括波特率设置、奇偶校验设置、停止位个数设置、中断方式设置和清除缓存FIFO。In the above-mentioned data transmission method for ensuring the security of small-capacity buffer serial port communication, in step (1), the host computer initializes the serial port, and completes the configuration of the serial port working state, including baud rate setting, parity setting, stop bit number setting, Set and clear the cache FIFO in interrupt mode.
在上述保证小容量缓存串口通讯安全性的数据传输方法中,步骤(6)中传送状态机将缓存FIFO中的数据取空时间为:传送状态机从缓存FIFO中读取数据时间+传送状态机数据传送时间+移位寄存器的数据输出时间。In the above-mentioned data transmission method for ensuring the security of small-capacity buffered serial port communication, in step (6), the time for the transmission state machine to empty the data in the cache FIFO is: the time for the transmission state machine to read data from the cache FIFO + the time for the transmission state machine Data transfer time + data output time of shift register.
在上述保证小容量缓存串口通讯安全性的数据传输方法中,温度损耗系数ε在串口标称工作温度范围内,取值为1。In the above data transmission method for ensuring the security of small-capacity buffered serial port communication, the temperature loss coefficient ε is within the nominal operating temperature range of the serial port, and takes a value of 1.
在上述保证小容量缓存串口通讯安全性的数据传输方法中,最大中断时间T中断可以为连续的多个中断时间的累加。In the above-mentioned data transmission method for ensuring the security of small-capacity buffered serial port communication, the maximum interrupt time T interrupt may be the accumulation of multiple consecutive interrupt times.
在上述保证小容量缓存串口通讯安全性的数据传输方法中,缓存FIFO的容量N≤10字节。In the above data transmission method for ensuring the security of small-capacity buffered serial port communication, the capacity of the buffered FIFO is N≤10 bytes.
本发明与现有技术相比具有如下有益效果:Compared with the prior art, the present invention has the following beneficial effects:
(1)、本发明设计了一种全新的串口数据传输方法,首先给出了缓存FIFO的容量N,单字节的数据传输时间T以及最大中断时间T中断之间的关系,在不同的数据传输时刻判断缓存FIFO的工作状态,根据缓存FIFO不同状态采取不同的传输策略,从而保证了串口通讯的可靠性和连续性,防止中断打断对数据传输的影响;(1), the present invention designs a kind of brand-new serial port data transmission method, firstly provides the capacity N of cache FIFO, the relation between the data transmission time T of single byte and the maximum interruption time T interruption , in different data Judging the working status of the buffer FIFO at the time of transmission, and adopting different transmission strategies according to different states of the buffer FIFO, thus ensuring the reliability and continuity of serial communication and preventing interruptions from affecting data transmission;
(2)、本发明数据传输方法根据缓存FIFO容量、单字节的数据传输时间、最大中断处理时间等固有特性设计,同时适用与大容量FIFO与小容量FIFO,尤其适用于容量≤10字节的小容量FIFO;(2) The data transmission method of the present invention is designed according to inherent characteristics such as cache FIFO capacity, single-byte data transmission time, and maximum interrupt processing time, and is applicable to both large-capacity FIFO and small-capacity FIFO, especially for capacity ≤ 10 bytes small-capacity FIFO;
(3)、本发明可以通过小容量缓存FIFO实现数据传输,降低了使用成本,并且实现过程简单、易于实现,具有较强的实用性;本发明数据传输方法特别适用于航空、航天、船舶等对电子元器件有特殊要求的领域。(3) The present invention can realize data transmission through a small-capacity buffer FIFO, which reduces the cost of use, and the realization process is simple, easy to implement, and has strong practicability; the data transmission method of the present invention is especially suitable for aviation, aerospace, ships, etc. Fields with special requirements for electronic components.
附图说明Description of drawings
图1为本发明硬件设备连接关系图;Fig. 1 is a connection diagram of hardware equipment of the present invention;
图2为本发明的串口通讯数据传输方法流程图。FIG. 2 is a flow chart of the serial communication data transmission method of the present invention.
具体实施方式Detailed ways
下面结合附图和具体实施例对本发明作进一步详细的描述:Below in conjunction with accompanying drawing and specific embodiment the present invention is described in further detail:
本发明所解决的核心技术问题是在FIFO资源不足的情况下保证串口通讯的实时性和连续性。在嵌入式软件运行期间,中断的产生无处不在,其中断频率、中断源、中断处理时间各不相同,无论何种中断,只要其产生时机或处理过程与串口通讯过程产生冲突都会影响串口的正常通讯。以某控制系统为例,控制计算机与某载荷通过RS422串口通讯,根据载荷要求,控制计算机发送数据字节间隔<50μs,即载荷在收到上字节数据后50μs内收不到下字节数据则任务通讯失败并自动结束此次通讯。而中断处理时间约200μs,若中断打在两个字节的发送间隔,势必引起通讯超时而导致通讯失败。The core technical problem solved by the invention is to ensure the real-time and continuity of serial port communication under the condition of insufficient FIFO resources. During the operation of embedded software, interrupts are generated everywhere, and their interrupt frequency, interrupt source, and interrupt processing time are different. No matter what kind of interrupt, as long as its generation timing or processing conflicts with the serial port communication process, it will affect the serial port. Normal communication. Taking a certain control system as an example, the control computer communicates with a load through the RS422 serial port. According to the requirements of the load, the control computer sends the data byte interval <50μs, that is, the load cannot receive the next byte data within 50μs after receiving the upper byte data. Then task communication fails and the communication ends automatically. The interrupt processing time is about 200μs. If the interrupt is sent at the interval of two bytes, it will inevitably cause communication overtime and cause communication failure.
为保证通讯的连续性,其关键是保证从使能串口发送到数据发送完毕整个过程期间字节的时间间隔必须在要求时间以内。由于FIFO资源的限制(FIFO深度<数据长度),若采用传统大缓存的通讯方式一次性将FIFO填满,由于仍存在尚未发完的数据,在两次写数的过程之间仍无法避免中断的打断,为此本发明根据FIFO深度、字节间传输时间、中断处理时间等固有特性,设计了一种保证小容量缓存串口通讯安全性的技术方案。本发明数据传输方法同时适用与大容量缓存FIFO与小容量缓存FIFO,尤其适用于容量≤10字节的小容量缓存FIFO。In order to ensure the continuity of communication, the key is to ensure that the time interval of the byte during the whole process from enabling the serial port to sending the data must be within the required time. Due to the limitation of FIFO resources (FIFO depth < data length), if the traditional large buffer communication method is used to fill the FIFO at one time, because there are still unsent data, interruptions cannot be avoided between the two writing processes For this reason, the present invention designs a technical solution to ensure the security of small-capacity buffered serial port communication based on inherent characteristics such as FIFO depth, byte-to-byte transmission time, and interrupt processing time. The data transmission method of the present invention is applicable to large-capacity buffer FIFO and small-capacity buffer FIFO at the same time, especially suitable for small-capacity buffer FIFO with capacity ≤ 10 bytes.
如图1所示为本发明硬件设备连接关系图,本发明实现数据传输的硬件设备包括上位机、串口和下位机,其中串口为上位机与下位机的接口,串口包括缓存FIFO、传送状态机和移位寄存器。设缓存FIFO的容量为N,单字节的数据传输时间为T,最大中断时间为T中断,满足如下公式:As shown in Fig. 1, it is the connection diagram of the hardware equipment of the present invention, the hardware equipment that the present invention realizes data transmission comprises upper computer, serial port and lower computer, and wherein serial port is the interface of upper computer and lower computer, and serial port includes cache FIFO, transmission state machine and shift registers. Let the capacity of the cache FIFO be N, the data transmission time of a single byte be T, and the maximum interrupt time be T interrupt , which satisfies the following formula:
其中:ε为温度损耗系数,温度损耗系数ε在串口标称工作温度范围内,通常取值为1。Among them: ε is the temperature loss coefficient, and the temperature loss coefficient ε is within the nominal operating temperature range of the serial port, and the value is usually 1.
本发明保证小容量缓存串口通讯安全性的数据传输方法包括如下步骤,如图2所示为本发明的串口通讯数据传输方法流程图:The data transmission method that the present invention guarantees the security of small-capacity cache serial port communication comprises the following steps, as shown in Figure 2 is the flow chart of the serial port communication data transmission method of the present invention:
(1)首先上位机对串口进行初始化,完成串口工作状态配置,具体包括波特率设置、奇偶校验设置、停止位个数设置、中断方式设置(时钟)和清除缓存FIFO。(1) First, the host computer initializes the serial port and completes the serial port working status configuration, including baud rate setting, parity setting, stop bit number setting, interrupt mode setting (clock) and clearing the cache FIFO.
(2)接着上位机向传送状态机发送控制指令,传送状态机根据控制指令停止数据传输;(2) Then the host computer sends a control command to the transmission state machine, and the transmission state machine stops data transmission according to the control command;
(3)之后上位机将数据写入缓存FIFO,写入的数据个数小于或等于缓存FIFO的容量N,同时上位机向传送状态机发出控制指令;(3) Afterwards, the upper computer writes the data into the buffer FIFO, and the number of written data is less than or equal to the capacity N of the buffer FIFO, and at the same time, the upper computer sends a control command to the transmission state machine;
(4)传送状态机根据步骤(3)的控制指令从缓存FIFO中读取数据并传送到移位寄存器,移位寄存器将数据输出给下位机;(4) The transmission state machine reads the data from the cache FIFO according to the control instruction in step (3) and transmits it to the shift register, and the shift register outputs the data to the lower computer;
(5)上位机判断缓存FIFO的状态,若缓存FIFO容量已满,则等待,若缓存FIFO容量未满,则进入步骤(6);(5) The host computer judges the status of the cache FIFO, if the cache FIFO capacity is full, then wait, if the cache FIFO capacity is not full, then enter step (6);
(6)若缓存FIFO中已使用容量≥2字节,则上位机向缓存FIFO中未使用容量写入数据,进入步骤(7);若缓存FIFO中已使用容量<2字节,则上位机停止向缓存FIFO中写入数据,待传送状态机将缓存FIFO中的数据取空后,进入步骤(7);其中数据取空时间即:传送状态机从缓存FIFO中读取数据时间+传送状态机数据传送时间+移位寄存器的数据输出时间。(6) If the used capacity in the cache FIFO is ≥ 2 bytes, the host computer writes data to the unused capacity in the cache FIFO, and enters step (7); if the used capacity in the cache FIFO is < 2 bytes, the host computer Stop writing data into the cache FIFO, and enter step (7) after the transmission state machine empties the data in the cache FIFO; the data emptying time is: the time when the transmission state machine reads data from the cache FIFO + transmission status Machine data transfer time + shift register data output time.
(7)上位机判断数据是否发完,若已发完,结束数据发送;若未发完,则进入步骤(2)。(7) The host computer judges whether the data has been sent, if it has been sent, end the data transmission; if not, go to step (2).
上述最大中断时间T中断可以为连续的多个中断时间的累加。The above-mentioned maximum interruption time T interruption may be the accumulation of a plurality of continuous interruption times.
上述步骤中等待时间的选择要充分考虑等待开始时刻缓存FIFO中的数据量及其被取出缓存FIFO后的传输时间,并考虑一定余量,避免一旦发生异常而造成的软件“死等”。The selection of the waiting time in the above steps should fully consider the amount of data in the buffer FIFO at the beginning of waiting and the transmission time after it is taken out of the buffer FIFO, and consider a certain margin to avoid software "dead waiting" once an exception occurs.
实施例1Example 1
以缓存FIFO容量为4字节为例,数据传输方法包括如下步骤:Taking the cache FIFO capacity as 4 bytes as an example, the data transmission method includes the following steps:
(1)上位机对串口进行初始化,完成串口工作状态配置,具体包括波特率设置、奇偶校验设置、停止位个数设置、中断方式设置(时钟)和清除FIFO。(1) The host computer initializes the serial port and completes the configuration of the serial port working status, including baud rate setting, parity setting, stop bit number setting, interrupt mode setting (clock) and clearing FIFO.
(2)上位机向传送状态机发送控制指令,传送状态机根据控制指令停止数据传输。(2) The upper computer sends control instructions to the transmission state machine, and the transmission state machine stops data transmission according to the control instructions.
(3)上位机将数据写入缓存FIFO,写入的数据个数小于或等于缓存FIFO的容量N,同时上位机向传送状态机发出控制指令。(3) The host computer writes data into the cache FIFO, and the number of written data is less than or equal to the capacity N of the cache FIFO, and at the same time, the host computer sends a control command to the transmission state machine.
(4)传送状态机根据控制指令从缓存FIFO中读取数据并传送到移位寄存器,移位寄存器将所述数据输出给下位机。(4) The transmission state machine reads the data from the buffer FIFO according to the control instruction and transmits it to the shift register, and the shift register outputs the data to the lower computer.
(5)上位机判断缓存FIFO的状态,此时缓存FIFO容量为3字节,处于未满状态,则进入步骤(6)。(5) The upper computer judges the status of the buffer FIFO, and the capacity of the buffer FIFO is 3 bytes at this time, which is not full, and then enters step (6).
(6)判断缓存FIFO中已使用容量≥2字节,上位机向缓存FIFO中写入1个字节数据,缓存FIFO中数据已满,进入步骤(7)。(6) Judging that the used capacity in the buffer FIFO is ≥ 2 bytes, the host computer writes 1 byte of data into the buffer FIFO, and the data in the buffer FIFO is full, and then enter step (7).
(7)上位机判断数据未发完,进入步骤(2)。若已发完,则结束发送。(7) The upper computer judges that the data has not been sent, and enters step (2). If it has been sent, end sending.
实施例2Example 2
仍以缓存FIFO容量为4字节为例,数据传输方法包括如下步骤:Still taking the buffer FIFO capacity as 4 bytes as an example, the data transmission method includes the following steps:
(1)上位机对串口进行初始化,完成串口工作状态配置,具体包括波特率设置、奇偶校验设置、停止位个数设置、中断方式设置(时钟)和清除FIFO。(1) The host computer initializes the serial port and completes the configuration of the serial port working status, including baud rate setting, parity setting, stop bit number setting, interrupt mode setting (clock) and clearing FIFO.
(2)上位机向传送状态机发送控制指令,传送状态机根据控制指令停止数据传输。(2) The upper computer sends control instructions to the transmission state machine, and the transmission state machine stops data transmission according to the control instructions.
(3)上位机将数据写入缓存FIFO,写入的数据个数小于或等于缓存FIFO的容量N,同时上位机向传送状态机发出控制指令。(3) The host computer writes data into the cache FIFO, and the number of written data is less than or equal to the capacity N of the cache FIFO, and at the same time, the host computer sends a control command to the transmission state machine.
(4)传送状态机根据控制指令从缓存FIFO中读取数据并传送到移位寄存器,移位寄存器将所述数据输出给下位机。(4) The transmission state machine reads the data from the buffer FIFO according to the control instruction and transmits it to the shift register, and the shift register outputs the data to the lower computer.
(5)上位机判断缓存FIFO的状态,此时缓存FIFO容量为1字节,处于未满状态,则进入步骤(6)。(5) The upper computer judges the status of the buffer FIFO, and the capacity of the buffer FIFO is 1 byte at this time, which is not full, and then enters step (6).
(6)判断缓存FIFO中已使用容量<2字节,上位机停止向缓存FIFO中写入数据,待传送状态机将缓存FIFO中的数据取空后,进入步骤(7);其中数据取空时间即:传送状态机从缓存FIFO中读取数据时间+传送状态机数据传送时间+移位寄存器的数据输出时间。(6) Judging that the used capacity in the buffer FIFO is less than 2 bytes, the host computer stops writing data into the buffer FIFO, and after the data in the buffer FIFO is emptied by the transmission state machine, enter step (7); where the data is emptied The time is: the time when the transmission state machine reads data from the cache FIFO + the data transmission time of the transmission state machine + the data output time of the shift register.
(7)上位机判断数据是否发完,若已发完,结束数据发送;若未发完,则进入步骤(2)。(7) The host computer judges whether the data has been sent, if it has been sent, end the data transmission; if not, go to step (2).
以上所述,仅为本发明最佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。The above description is only the best specific implementation mode of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of changes or modifications within the technical scope disclosed in the present invention. Replacement should be covered within the protection scope of the present invention.
本发明说明书中未作详细描述的内容属于本领域专业技术人员的公知技术。The content that is not described in detail in the specification of the present invention belongs to the well-known technology of those skilled in the art.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310371637.7A CN103488595B (en) | 2013-08-23 | 2013-08-23 | A kind of data transmission method ensureing low capacity cache serial communication safety |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310371637.7A CN103488595B (en) | 2013-08-23 | 2013-08-23 | A kind of data transmission method ensureing low capacity cache serial communication safety |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103488595A true CN103488595A (en) | 2014-01-01 |
CN103488595B CN103488595B (en) | 2015-10-21 |
Family
ID=49828840
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310371637.7A Active CN103488595B (en) | 2013-08-23 | 2013-08-23 | A kind of data transmission method ensureing low capacity cache serial communication safety |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103488595B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109062847A (en) * | 2018-07-31 | 2018-12-21 | 深圳职业技术学院 | System on chip, IP kernel and its control method for RS485 serial communication |
CN109939310A (en) * | 2017-12-20 | 2019-06-28 | 北京谊安医疗系统股份有限公司 | The slave computer of ventilator sends the method and ventilator of data to host computer |
CN114356831A (en) * | 2022-03-18 | 2022-04-15 | 苏州联讯仪器有限公司 | Serial port communication method, device, equipment and computer readable storage medium |
CN114697267A (en) * | 2022-03-06 | 2022-07-01 | 道莅智远科技(青岛)有限公司 | Industrial control PLC real-time data communication interruption continuous transmission optimization algorithm |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100201548A1 (en) * | 2007-09-25 | 2010-08-12 | Renesas Technology Corp. | Parallel data output control circuit and semiconductor device |
CN102541780A (en) * | 2011-12-15 | 2012-07-04 | 苏州国芯科技有限公司 | Multi-data stream channel DMA (Direct Memory Access) system |
CN102937939A (en) * | 2012-10-10 | 2013-02-20 | 无锡众志和达存储技术股份有限公司 | DMA (Direct Memory Access) address couple pre-reading method based on SATA (Serial Advanced Technology Attachment) controller |
-
2013
- 2013-08-23 CN CN201310371637.7A patent/CN103488595B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100201548A1 (en) * | 2007-09-25 | 2010-08-12 | Renesas Technology Corp. | Parallel data output control circuit and semiconductor device |
CN102541780A (en) * | 2011-12-15 | 2012-07-04 | 苏州国芯科技有限公司 | Multi-data stream channel DMA (Direct Memory Access) system |
CN102937939A (en) * | 2012-10-10 | 2013-02-20 | 无锡众志和达存储技术股份有限公司 | DMA (Direct Memory Access) address couple pre-reading method based on SATA (Serial Advanced Technology Attachment) controller |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109939310A (en) * | 2017-12-20 | 2019-06-28 | 北京谊安医疗系统股份有限公司 | The slave computer of ventilator sends the method and ventilator of data to host computer |
CN109062847A (en) * | 2018-07-31 | 2018-12-21 | 深圳职业技术学院 | System on chip, IP kernel and its control method for RS485 serial communication |
CN109062847B (en) * | 2018-07-31 | 2023-08-25 | 深圳职业技术学院 | System on chip, IP core for RS485 serial communication and its control method |
CN114697267A (en) * | 2022-03-06 | 2022-07-01 | 道莅智远科技(青岛)有限公司 | Industrial control PLC real-time data communication interruption continuous transmission optimization algorithm |
CN114697267B (en) * | 2022-03-06 | 2024-02-02 | 道莅智远科技(青岛)有限公司 | Intermittent transmission optimization method in industrial control PLC real-time data communication |
CN114356831A (en) * | 2022-03-18 | 2022-04-15 | 苏州联讯仪器有限公司 | Serial port communication method, device, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103488595B (en) | 2015-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7930470B2 (en) | System to enable a memory hub device to manage thermal conditions at a memory device level transparent to a memory controller | |
CN114564427B (en) | A bus bridge, system and method from AHB bus to I2C bus | |
CN102647320B (en) | Integrated circuit suitable for high-speed 1553 bus protocol control | |
CN107301138B (en) | A kind of universal serial bus bridging method and serial bus system | |
EP3827356A1 (en) | Unified address space for multiple hardware accelerators using dedicated low latency links | |
JP2010514063A (en) | Bridging Serial Advanced Technology Attachment (SATA) and Serial Attached Small Computer System Interface (SCSI) (SAS) | |
US8327053B2 (en) | Bus control system and semiconductor integrated circuit | |
CN103488595B (en) | A kind of data transmission method ensureing low capacity cache serial communication safety | |
CN103218313B (en) | For realizing the mutual method of buffer descriptor and electronic equipment | |
US8386908B2 (en) | Data transmission methods and universal serial bus host controllers utilizing the same | |
US9672180B1 (en) | Cache memory management system and method | |
JP2012073851A (en) | Bus system and deadlock avoidance circuit thereof | |
CN102541779A (en) | System and method for improving direct memory access (DMA) efficiency of multi-data buffer | |
CN109491946A (en) | A kind of chip and method for I2C bus extension | |
CN104516478B (en) | Plant capacity is throttled | |
CN106371807A (en) | Method and device for extending processor instruction set | |
CN102749986A (en) | USB 3.0 main control device and method for reducing low power consumption thereof | |
CN101558389A (en) | Selective guarded memory access on a per-instruction basis | |
US7996206B2 (en) | Serial attached small computer system interface (SAS) connection emulation for direct attached serial advanced technology attachment (SATA) | |
CN103823785A (en) | Multi-way ARINC429 data transmit-receive circuit structure based on development of DSP and CPLD | |
TW200521678A (en) | Virtual first-in, first-out DMA device | |
CN103389923A (en) | Random access memory access bus ECC (error checking and correcting) verification device | |
US20090113092A1 (en) | Signal converter for debugging that expands fifo capacity | |
KR102668564B1 (en) | Peripheral component interconnect express interface device and operating method thereof | |
CN101882084B (en) | Data processing device for basic input output system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |