CN100365609C - Data transmission method between host and USB device and corres ponding USB device - Google Patents

Data transmission method between host and USB device and corres ponding USB device Download PDF

Info

Publication number
CN100365609C
CN100365609C CNB2005101304842A CN200510130484A CN100365609C CN 100365609 C CN100365609 C CN 100365609C CN B2005101304842 A CNB2005101304842 A CN B2005101304842A CN 200510130484 A CN200510130484 A CN 200510130484A CN 100365609 C CN100365609 C CN 100365609C
Authority
CN
China
Prior art keywords
data
impact damper
occupation rate
usb device
sampled data
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.)
Expired - Fee Related
Application number
CNB2005101304842A
Other languages
Chinese (zh)
Other versions
CN1776656A (en
Inventor
张倩
朱小琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vimicro Corp
Original Assignee
Vimicro Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Vimicro Corp filed Critical Vimicro Corp
Priority to CNB2005101304842A priority Critical patent/CN100365609C/en
Publication of CN1776656A publication Critical patent/CN1776656A/en
Application granted granted Critical
Publication of CN100365609C publication Critical patent/CN100365609C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The present invention provides a USB data transmission method to prevent the problem that a buffer generates overflow or underflow because of the clock inconsistency of a host and a USB device during USB data transmission. The method is characterized in that a sampling value is discarded or increased by detecting the occupation ratio level of a buffer in real time and comparing the detecting result with a preset storage limit mark. The present invention also provides a USB device which comprises a detecting module for detecting the occupation ratio level of the buffer and increasing or discarding sampling data through a control module, which avoids the generation of the overflow or the underflow of the buffer.

Description

Carry out the method and the corresponding USB device of data transmission between a kind of main frame and the USB device
Technical field
The present invention relates to field of data transmission, particularly based on the data transmission of usb protocol.
Technical background
USB (universal serial bus) (Universal Serial Bus) is the peripheral interface of a new generation, and the transfer rate of this interface is all faster many than the employed parallel port of personal computer or the speed of serial port.Article one, USB (universal serial bus) can connect 127 equipment at most, as CD drive, scanner, printer or the like.These equipment are connected to main frame (host) for example on the personal computer by identical interface, thereby have simplified the personal computer connecting interface type as main frame.
As shown in Figure 1, utilizing usb bus to carry out in the data transmission procedure, main frame sends the clock of data or reception data and USB device receives or always there is certain error in the clock of transmission data, so the impact damper of device interior just may occur not having data can export (underflow underflow) or data volume exceeds the phenomenon of buffer stores maximum space restriction (overflow overflow).In data transfer procedure, two kinds of situations are generally arranged, a kind of is data inputs (in), expression data flow main frame; A kind of is data outputs (out), and the expression data flow out main frame.For both of these case, all to consider the asymmetric problem of bringing of main frame and equipment clock.Be that example is introduced with data inputs (in) below.As shown in Figure 2, also continuing rising with the posterior bumper occupation rate, and reaching the storage cap of described impact damper soon at 5ms.Like this in main frame sense data and making before the occupation rate of impact damper descends once more in described impact damper, will some data that come from equipment be dropped because not being written into described impact damper.As shown in Figure 3, still continue to descend with the posterior bumper occupation rate at 5ms, and the data in the very fast described impact damper are just read sky, write data and make before the occupation rate of impact damper rises once more to impact damper in USB device like this, will not have and can data can be transferred to main frame.
No matter adopt the usb data transmission in video still is voice applications, the overflow of impact damper or underflow all can cause the interruption of image or sound or unnecessary interference.
Summary of the invention
The objective of the invention is to avoid in data transmission procedure, taking place in the USB device overflow or the underflow of impact damper.For achieving the above object, the present invention has put down in writing following technical scheme:
A kind of method of carrying out data transmission between main frame and USB device comprises: detect the operation of the buffer data occupation rate in the USB device; The operation that the situation of described buffer data occupation rate is judged; Increase sampled data or abandon the operation of sampled data according to judged result.
Wherein, if described buffer data occupation rate is lower than pre-set storage lower limit mark, carry out the operation of described increase sampled data; If the buffer data occupation rate is higher than pre-set storage cap mark, carry out the described operation that abandons sampled data.
Preferably, when the impact damper occupation rate is higher than pre-set storage cap mark, the operation of record buffer output data number of times; And reach a pre-set count value for the moment when described impact damper output data number of times, carry out the described operation that abandons sampled data.If described buffer data occupation rate is lower than pre-set storage lower limit mark, the operation of opening entry impact damper output data number of times; When described impact damper output data number of times reaches pre-set count value two, carry out the operation of described increase sampled data.The operation of described increase sampled data can be an interpolation operation, particularly linear interpolation operation.
The present invention has also put down in writing a kind of USB device, comprise a control module and impact damper, and the detection module that the data occupation rate of described impact damper is detected, this detection module sends to described control module with testing result, and described control module increases sampled data or abandons sampled data according to testing result.
Wherein, described USB device also comprises an interpolator, and described control module increases sampled data by the control to this interpolator.Described interpolator is can be the linear interpolation device.
Described detection module storage inside in described USB device has pre-set upper and lower bound mark value; If the testing result that described detection module obtains is described lower limit mark for the impact damper occupation rate is lower than, described control module increases sampled data; If the testing result that described detection module obtains is described upper limit mark for the impact damper occupation rate is higher than, described control module abandons sampled data.
In addition, if the testing result that obtains of described detection module for the impact damper occupation rate is higher than described upper limit mark, then described counter begins counting; When counter value a period of time that described rolling counters forward to configures, detection module sends testing result to control module, and control module abandons sampled data.Described USB device also comprises a counter; If the testing result that described detection module obtains is described lower limit mark for the impact damper occupation rate is lower than, then described counter begins counting; When counter value two that described rolling counters forward to configures, detection module sends testing result to control module, and control module increases sampled data.
In addition, described upper limit mark, lower limit mark, count value one and count value two all are configurable.
Technical scheme that the present invention puts down in writing has effectively been avoided because on main frame and the asymmetric impact damper that brings of USB device clock/the underflow problem, and is guaranteeing the smooth transmission of data.
Description of drawings
Fig. 1 is a prior art USB system construction drawing;
Fig. 2 is the situation synoptic diagram of USB device generation buffer overflows;
Fig. 3 is the situation synoptic diagram of USB device generation buffer underflow;
Fig. 4 is the process flow diagram of a preferred embodiment of usb data transmission method of the present invention;
Fig. 5 is the situation synoptic diagram that USB device of the present invention prevents buffer overflows;
Fig. 6 is the situation synoptic diagram that USB device of the present invention prevents buffer underflow;
Fig. 7 is the structural drawing of USB device of the present invention;
Fig. 8 is another structural drawing of USB device of the present invention.
Embodiment
The present invention provides a kind of new usb data transmission method for realizing aforesaid goal of the invention.In data transmission procedure, two kinds of situations are generally arranged, a kind of is data inputs (in), expression data flow main frame; A kind of is data outputs (out), and the expression data flow out main frame.For both of these case, all to consider the asymmetric problem of bringing of main frame and equipment clock.Be that example is introduced with data inputs (in) below, the situation and the input (in) of data outputs (out) are similar.
Figure 4 shows that a preferred embodiment of usb data transmission method of the present invention.In a certain moment of data transmission, detect for the data occupation rate of the impact damper in the USB device.If this occupation rate is higher than a pre-set storage cap mark value, so just begin counting, when count value equals a pre-set count value a period of time, just abandon the sampled data that will write described impact damper, and detect the data occupation rate of described impact damper once more.If this moment, this data occupation rate was not reduced to certain level, for example 50% of the impact damper maximum memory space, then restart counting, abandon a sampled data for the moment once more when counting down to described count value.Operation is reduced to needed level up to the data occupation rate like this.
In a certain moment of data transmission, detect for the data occupation rate of the impact damper in the USB device.If this occupation rate is lower than a pre-set storage lower limit mark value, the same counting that also just begins, when count value equals a pre-set count value two, just increase a sampled data and it is flowed to main frame, and detect the data occupation rate of described impact damper once more.If this moment, this data occupation rate was not brought up to certain level, for example 50% of the impact damper maximum memory space, then restart counting, when counting down to described count value two, increase a sampled data once more and flow to main frame.Operation is brought up to needed level up to the data occupation rate like this.Wherein, the operation that increases sampled data can realize by interpolation operation, such as linear interpolation operation or quadratic interpolation operation.
Described upper limit mark value, lower limit mark value can dispose, and can set according to the data transmission and the reading speed of USB device and main frame.Same, count value one, two also can dispose, and can transmit and reading speed according to the data of USB device and main frame equally, and system's acceptable abandons or increases the degree of sampled data and set.
What show among Fig. 5 is after having adopted the data transmission method that the present invention put down in writing, at 5ms later on when the data in the impact damper will continue to increase, the occupation rate of impact damper will be limited near the level of upper limit mark, and makes the occupation rate of storer drop to certain level by the operation that abandons sampled data.
What Fig. 6 showed is after having adopted the data transmission method that the present invention put down in writing, at 5ms later on when the data in the impact damper will continue to reduce, the occupation rate of impact damper will be limited near the level of lower limit mark, and makes the occupation rate of storer bring up to certain level by the operation that increases sampled data.
The present invention also provides a kind of new USB device as shown in Figure 7.Described USB device S comprises a detection module T, is storing the value of the upper limit mark and the lower limit mark of described impact damper B occupation rate among this detection module T.The data occupation rate level of impact damper B can be by the real-time described detection module T that is transported to, through T relatively, if the data occupation rate level of described impact damper B is higher than described upper limit mark, for example 80% of the impact damper maximum memory space, detection module T transmits a signal to control module C so, and C just abandons the data that the next one will write described impact damper.Preferred, as shown in Figure 8, described USB device also comprises a counter O.When described detection module T learnt that the occupation rate of described impact damper B has surpassed upper limit mark, detection module T also sent enabling signal to described counter O when sending a signal to control module C, and counter O begins counting.When the count value of counter O reaches a certain pre-set count value for the moment, counter O sends a command to control module C, and then C just abandons the data that the next one will write described impact damper B.At this moment, counter O makes zero and begins and counts again, when counting down to described count value once more for the moment, control module C abandon once more one will write buffer B data.Such operation is repeated until that occupation rate that detection module T detects described impact damper B has been reduced to the level far below the impact damper max cap., for example 50%, just stop to abandon data.
As shown in Figure 7, the data occupation rate level of impact damper B by real-time be transported to described detection module T after, comparison through T, if the data occupation rate level of described impact damper B is lower than described lower limit mark, for example 20% of impact damper B maximum memory space, detection module T transmits a signal to control module C so, and C just increases a new sampled data and flows to main frame H.Preferred, as shown in Figure 8, described USB device also comprises a counter O and interpolator I.When described detection module T learnt that the occupation rate of described impact damper B has been lower than the lower limit mark, detection module T also sent enabling signal to described counter O when transmitting a signal to control module C, and counter O begins counting.When the count value of counter O reached a certain pre-set count value two, counter O sent a command to control module C, and then C just orders interpolator I to produce new data and flows to main frame H.At this moment, counter O makes zero and begins and counts again, and when O count down to described count value two once more, control module C ordered interpolator I to produce new sampled data once more and flows to main frame H.Such operation repeats always, and the occupation rate that detects described impact damper B up to detection module T has risen to the certain capacity level, and for example 50% of the impact damper maximum memory space, just stop to insert data.Preferably, described interpolator I can be the linear interpolation device, by reading a previous sampled data and a back sampled data from impact damper, and these two sampled datas are got arithmetic mean obtains new data and exports to main frame H.Certainly, I also can be other interpolator such as quadratic interpolation device.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement etc., all should be included within protection scope of the present invention.

Claims (6)

1. method of carrying out data transmission between main frame and USB device is characterized in that this method comprises:
Detect the operation of the buffer data occupation rate in the USB device;
The operation that the situation of described buffer data occupation rate is judged;
Increase sampled data or abandon the operation of sampled data according to judged result;
If the buffer data occupation rate is higher than pre-set storage cap mark, carry out the described operation that abandons sampled data;
If described buffer data occupation rate is lower than pre-set storage lower limit mark, carry out the operation of described increase sampled data;
When the impact damper occupation rate is higher than pre-set storage cap mark, the operation of record buffer output data number of times; And reach a pre-set count value for the moment when described impact damper output data number of times, carry out the described operation that abandons sampled data;
If described buffer data occupation rate is lower than pre-set storage lower limit mark, the operation of opening entry impact damper output data number of times; When described impact damper output data number of times reaches pre-set count value two, carry out the operation of described increase sampled data.
2. data transmission method as claimed in claim 1, the operation that it is characterized in that described increase sampled data is an interpolation operation.
3. data transmission method as claimed in claim 2 is characterized in that described interpolation operation is the linear interpolation operation.
4. data transmission method as claimed in claim 1 is characterized in that described upper limit mark, lower limit mark, and count value one and count value two all can dispose.
5. USB device, comprise a control module and impact damper, it is characterized in that this USB device also comprises the detection module that the data occupation rate to described impact damper detects, this detection module sends to described control module with testing result, and described control module increases sampled data or abandons sampled data according to testing result;
Described USB device also comprises an interpolator, and described control module increases sampled data by the control to this interpolator;
Described interpolator is the linear interpolation device;
In described detection module storage inside pre-set upper and lower bound mark value is arranged;
If the testing result that described detection module obtains is described lower limit mark for the impact damper occupation rate is lower than, described control module increases sampled data;
If the testing result that described detection module obtains is described upper limit mark for the impact damper occupation rate is higher than, described control module abandons sampled data;
This equipment also comprises a counter;
If the testing result that described detection module obtains is described upper limit mark for the impact damper occupation rate is higher than, then described counter begins counting; When counter value a period of time that described rolling counters forward to configures, detection module sends testing result to control module, and control module abandons sampled data;
If the testing result that described detection module obtains is described lower limit mark for the impact damper occupation rate is lower than, then described counter begins counting; When counter value two that described rolling counters forward to configures, detection module sends testing result to control module, and control module increases sampled data.
6. USB device as claimed in claim 5 is characterized in that described upper limit mark, lower limit mark, count value one and count value two all are configurable.
CNB2005101304842A 2005-12-13 2005-12-13 Data transmission method between host and USB device and corres ponding USB device Expired - Fee Related CN100365609C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005101304842A CN100365609C (en) 2005-12-13 2005-12-13 Data transmission method between host and USB device and corres ponding USB device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005101304842A CN100365609C (en) 2005-12-13 2005-12-13 Data transmission method between host and USB device and corres ponding USB device

Publications (2)

Publication Number Publication Date
CN1776656A CN1776656A (en) 2006-05-24
CN100365609C true CN100365609C (en) 2008-01-30

Family

ID=36766165

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005101304842A Expired - Fee Related CN100365609C (en) 2005-12-13 2005-12-13 Data transmission method between host and USB device and corres ponding USB device

Country Status (1)

Country Link
CN (1) CN100365609C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335324B (en) * 2015-12-04 2018-09-14 上海兆芯集成电路有限公司 The method of receiver and reception data for high-speed serial bus
CN114510362A (en) * 2022-02-18 2022-05-17 歌尔股份有限公司 Data caching processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW413763B (en) * 1999-03-16 2000-12-01 Winbond Electronics Corp Data conversion device and data flow control method in between USB host and network end
US6678243B2 (en) * 1997-11-14 2004-01-13 Ess Technology, Inc. Variable codec frame length
CN1574784A (en) * 2003-06-11 2005-02-02 三星电子株式会社 Transceiving network controller and method for controlling buffer memory allocation and data flow
CN1625052A (en) * 2003-12-04 2005-06-08 雅马哈株式会社 Asynchronous signal input device and sampling frequency conversion device
US20050235089A1 (en) * 2004-04-02 2005-10-20 Fred Cheng Method and apparatus for universal serial bus (USB) physical layer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6678243B2 (en) * 1997-11-14 2004-01-13 Ess Technology, Inc. Variable codec frame length
TW413763B (en) * 1999-03-16 2000-12-01 Winbond Electronics Corp Data conversion device and data flow control method in between USB host and network end
CN1574784A (en) * 2003-06-11 2005-02-02 三星电子株式会社 Transceiving network controller and method for controlling buffer memory allocation and data flow
CN1625052A (en) * 2003-12-04 2005-06-08 雅马哈株式会社 Asynchronous signal input device and sampling frequency conversion device
US20050235089A1 (en) * 2004-04-02 2005-10-20 Fred Cheng Method and apparatus for universal serial bus (USB) physical layer

Also Published As

Publication number Publication date
CN1776656A (en) 2006-05-24

Similar Documents

Publication Publication Date Title
US20220123969A1 (en) Burst-tolerant decision feedback equalization
JP2009540681A5 (en)
KR101688051B1 (en) Data processing device and method using error detection code, method for compensating data skew and semiconductor device having data processing device
RU2559727C2 (en) Method and apparatus for enabling identifier based streams over pci express bus
CN102007539B (en) Sequence detection for flash memory with inter-cell interference
US10884920B2 (en) Metadata-based operations for use with solid state devices
CN100365609C (en) Data transmission method between host and USB device and corres ponding USB device
US20050033875A1 (en) System and method for selectively affecting data flow to or from a memory device
CN101052938B (en) Low latency data packet reception and processing
CN107153412B (en) A kind of CAN controller circuit with transmission FIFO
CN101246465A (en) General serial bus chip
CN112328523B (en) Method, device and system for transmitting double-rate signal
KR101593872B1 (en) Technologies for configuring transmitter equalization in a communication system
CN104380273A (en) Adaptive offset synchronization of data based on ring buffers
CN104050124A (en) Data transmission circuit and data transmission method applied to universal serial bus system
CN101246742B (en) Electronic device and its data transmission method
TWI782694B (en) De-skew circuit, de-skew method, and receiver
CN101894005A (en) Asynchronous FIFO transmission method from high-speed interfaces to low-speed interfaces
TWI243304B (en) Method and system for optimized first-in-first-out full condition control
US9311045B2 (en) Elastic buffer module and elastic buffering method for transmission interface
CN1945719B (en) Information recording apparatus, imaging device, information-recording controlling method
CN201044459Y (en) General serial bus chip
US11921649B1 (en) Multiple parallel mode flash channels with serial link
CN108898036B (en) Data read-write control method
JP2013206078A (en) Check device, memory system with command check function, and method

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080130

Termination date: 20111213