A kind of printer parallel port that improves disturbs adaptive method and system
Technical field:
The present invention relates to field of computer technology, relate in particular to a kind of method that promotes the Practical Performance of printer parallel interface, and system.
Background technology:
The IEEE1284 high speed parallel interface is one of the most widely used printer interface standard at present.In the Interface design of high-speed printer (HSP), the designing quality of antijamming capability and message transmission rate aspect is to user environment adaptability, job stability and the print speed important influence of printer product.
High speed development along with PC main frame soft hardware performance, the print job of more complicated at present, as Chinese character laser printing and graphic image output application, almost all or more and more adopt the bigger rastered picture compress mode of transmitted data amount, thus more and more higher to the requirement of the message transmission rate of printer parallel port.In order to satisfy the requirement of message transmission rate aspect, people often have to sacrifice the performance of interference prevention aspect, thereby the performance of host interface controller or the requirement of interface electric circumstance are improved thereupon.On the other hand,, generally have to again in present most product designs message transmission rate is limited within the 500K Byte/S for reduction interference prevention ability within reason, thus very unfavorable to the performance of giving full play to high speed laser printer.
Shown in Figure 1 is the anti-interference solution of a kind of typical printer parallel interface.XCtrol[3..0] expression printer parallel port 4 input control line: nInit, nSelectIn, nAutoFd, nStrobe; XD[7..0] 8 bidirectional data lines of expression; XStatus[4..0] 5 output state line: Perror of expression, nAck, Busy.nFault, Select.Fig. 2 a and Fig. 2 b are conventional printer parallel interface anti-interference electrical schematic diagrams commonly used: W is the limited amplitude protection diode, and Rup is the logic pull-up resistor, and T is the anti-phase reshaper of schmitt.In the side circuit design, generally satisfy condition: R<<Rup, R<<Rsr (phase inverter input resistance), so the parameter of R and C is selected and the V+ and the V-parameter of schmitt reshaper, determined the antijamming capability of this circuit and the message transmission rate that may reach basically.
Typical R C low-pass filter network has advantages such as the simple and hardware cost of circuit is low, but in the contradiction that exists some to be difficult to take into account aspect raising interference prevention ability and the data rate.For example: select bigger RC time constant favourable, but that the performance of message transmission rate aspect is easy to become is bad to improving the interference prevention ability.For example: according to IEEE1284 parallel interface standard, may be little in the signal pulse width of the nStrobe signal wire under the high speed ECP mode of operation to below the 500ns (referring to Fig. 3).According to the transient analysis knowledge of pulsing circuit, we know that the selection of RC parameter generally need be satisfied 3RC<500ns in order to satisfy the requirement of larger data transfer rate.Further the engineering estimation shows, in order to satisfy the requirement of 1Mbyte/S left and right sides data rate, this circuit effectively breadth extreme of the disturbing pulse of filtering is not easy to surpass 40ns, if so in non-signal spacing (40ns..500ns in this example), impulse disturbances occurs, as long as amplitude breaks through the threshold voltage V+ (about 1.6V) and the V-(about 0.8V) of schmitt reshaper, just cause printing error code or other stability problems probably so.
In the parallel port of main frame and printer is plugged into mode, many in the observed interference of equipment end with the appearance of monopulse " burr " form, but saltus step ring and random series pulse also have the generation example by chance.If disturb and appear at data line, cause the printing error code problem easily; If disturb and appear at control line, except error code, also often cause the confusion of IEEE1284 interface protocol state machine.Investigate the solution of above-mentioned routine, disturb effective guard plot (=<40ns) and signaling zone (>=have a very wide transitional region between 500ns), be the external manifestation of limit interferences protection and data rate capabilities lifting.In other words, if manage the lower limit of this transitional region is improved, but the upper limit remains unchanged even moves down, and is equivalent to above-mentioned two the main performance index that promote the printer parallel interface simultaneously so, and high-speed printer (HSP) is used highly significant.With regard at present common product design application technology, traditional simulation interference prevention technology is difficult to effectively and high performance price ratio ground solves this class problem.
Summary of the invention:
The objective of the invention is at the control line interference problem, propose a kind of simple and practical digitizing solution, and the system that is applicable to this method.
The method that the present invention proposes is to add digitizing interference prevention module in the control line loop of printer parallel interface, removes after the undesired signal, exports to follow-up IEEE1284 logic module again; The structure of described digitizing interference prevention module comprises: parameter register A, input comparator A, delay counter A, delay comparator A and sampling latch C; The step that this digitizing interference prevention module is removed undesired signal comprises:
1), sets the value of the count threshold X of undesired signal by parameter register A data rule of thumb.
2) input comparator A is by the output CtrolQ[3..0 of the latch C that relatively takes a sample] and control line input Ctrol[3..0], the various saltus steps of real time monitoring control line input; When the logic level of two groups of respective signal lines is identical, input comparator A will export invalid counting controling signal CountA, delay counter A be carried out the operation of " reset clearly 0 "; When the logic level of two groups of respective signal lines not simultaneously, input comparator A will export just effectively counting controling signal CountA, delay counter A be carried out the operation of " counting synchronously ".
3) when the count value of delay counter A is equal to or greater than the value of pre-set limit count threshold X of parameter register A, delay comparator A produces just effectively sampling control signal SampleC, sampling latch C is carried out the operation of " sampling is upgraded ", and the new data of taking a sample more is directly from control line input Ctrol[3..0];
4) the output CtrolQ[3..0 of sampling latch C] be exactly the control line signal that has suppressed impulse disturbances.
Control line input among the present invention can be by RC low-pass filter network and schmitt reshaper and external interface isolation.If data speed is had higher requirement, should note selecting suitable RC parameter value, in order to avoid the design expectation value is produced significantly influence.
Parameter register of the present invention can obtain the dynamic optimal setting of count threshold X by the CPU optimized Algorithm.Count threshold X can be according to the following formula value that concerns:
Xmin=<X<Xmax,
Xmin=Round(Tnoise/Tclock),
Xmax=Round(Tsignal/Tclock-2),
Wherein, Xmin is illustrated under the maximum data transfer rate expectation value qualifications, the minimum value restriction of threshold X, and Xmax is illustrated under the maximum data transfer rate expectation value qualifications, the restriction of the maximum occurrences of threshold X; Round represents the result of subsequent calculations is carried out rounding operation; Tclock represents the cycle of sampling clock; Tsignal represents the minimum signal pulse width that may occur in the control line, with the expectation value close association of message transmission rate; Tnoise=Max (Tnoise_p, Tnoise_c), the maximum interference pulse parameter that can effectively suppress that the expression design is wished.
The printer parallel port that improves of the present invention disturbs adaptive system, comprise the IEEE1284 protocol module, the printer controller module that is connected by control line with this protocol module, add digitizing interference prevention module in the control line loop of printer parallel interface, this digitizing interference prevention module comprises parameter register A, input comparator A, delay counter A, delay comparator A and sampling latch C, wherein parameter register A connects cpu i/f, input comparator A meets control signal Ctrol[3..0 by control line respectively] and the control signal CtrolQ[3..0 of sampling latch C output], delay counter A inserts the counting controling signal CountA of input comparator A output, the numerical value of delay comparator A difference access parameter register A and delay counter A output, sampling latch C is incoming control signal Ctrol[3..0 respectively] and the sampling control signal SampleC of delay comparator A output, and export control signal CtrolQ[3..0 to IEEE1284 protocol module and input comparator A].
The present invention is fit to following interference model:
1) on 1 or many control lines impulse disturbances can appear simultaneously;
2) the breadth extreme Tnoise_p of monopulse interference is not more than limiting design value Tnoise, and does not have other interference on the control line constantly apart from this interference initial point Tnoise;
3) the maximum duration T noise_c of train pulse interference is not more than limiting design value Tnoise, and does not have other interference on the control line constantly apart from this interference initial point Tnoise.
The characteristics of the inventive method are:
1) keeping under the higher data transmission rate precondition, the monopulse that the width that can effectively suppress to occur on the control line is not more than Tnoise disturbs, and the duration is not more than the train pulse interference of Tnoise;
2) between the antijamming capability of parallel port control line and data rate, a kind of certainly magnitude relation formula and simple numerical transformation way have been established.CPU control interface by the introducing of programmable parameter register, not only can increase the dirigibility (selecting) of engineering design as clock frequency, and can be according to actual needs further optimal control parameter, this digitizing transformation way is switched in a wider context flexibly;
3) the inventive method also can be applied to above the combination of part control line;
4) the inventive method is fit to adopt the product design technology of FPGA or ASIC.
Description of drawings:
Fig. 1: the typical anti-interference principle piece of printer parallel interface figure
Fig. 2 a, 2b: based on the anti-interference schematic diagram (the nStrobe signal wire is an example) of RC analog filtering technology
Fig. 3: the sequential chart example of the segment signal line of high-speed parallel mouth under the ECP mode of operation
Fig. 4: the introducing position description figure of the digitizing immunity module of printer parallel port
Fig. 5: the basic comprising form of digitizing immunity module
Fig. 6: the waveform synoptic diagram of impulse disturbances process of inhibition
Embodiment:
Referring to Fig. 5, digitizing interference prevention module of the present invention comprises: parameter register A, and input comparator A, delay counter A, delay comparator A and sampling latch C, principle of work can be described below:
Input comparator A is by the output CtrolQ[3..0 of the latch C that relatively takes a sample] and control line input Ctrol[3..0], the various saltus steps of real time monitoring control line input.When the logic level of two groups of respective signal lines is identical, input comparator A will export invalid counting controling signal CountA, delay counter A be produced the operation of " reset clearly 0 "; When the logic level of two groups of respective signal lines not simultaneously, input comparator A will export just effectively counting controling signal CountA, delay counter A be carried out the operation of " counting synchronously ".When the count value of delay counter A is equal to or greater than the value of pre-set limit count threshold X of parameter register A, delay comparator A produces just effectively sampling control signal SampleC, sampling latch C is carried out the operation of " sampling is upgraded ", and the new data of taking a sample more is directly from control signal wire Ctrol[3..0].The output CtrolQ[3..0 of sampling latch C] be exactly the control line signal that has suppressed impulse disturbances.
Parameter register A provides the setting of X limit value.The X limit value can be one or several fixing alternative empirical data, also can realize the dynamic optimal setting by cpu i/f.Optimum is provided with data and generally need obtains by CPU adaptive learning algorithm.
In this example, if sampling clock frequency Clock=40MHz, threshold value x=10 can effectively suppress to appear at the impulse disturbances that width on the control line or duration are not more than 250ns so, is significantly improved than the solution of routine.In the maximum occurrences limited range of X, threshold X obtains big more, and the interference range that protection can effectively be provided is also just big more, but leave for the IEEE1284 module the associated responses logic time delay nargin also can be more little.Surpass certain scope, along with the rising of threshold X, message transmission rate will begin to descend, and show to enter and need obtain the zone of interference prevention capability improving by reducing message transmission rate.
Fig. 6 waveform synoptic diagram can be used for illustrating the process of inhibition of impulse disturbances on the control line.Still closing with a part of signal logic in the ECP mode of operation is that example: nStrobe represents the normal control line gating signal waveform that sent by main frame parallel port controller; XLpStrb represents that the nStrobe signal wire is subjected to being reflected in after the impulse disturbances signal output waveform of Schmitt shaping isolator, and dash area is represented owing to disturbing original logical relation to be damaged; / LpStrb represents to handle through digital immunity module the respective signal waveform of back nStrobe, and original logical relation is restored; Busy represents the answer signal that returns main frame by follow-up IEEE1284 module generation.In the xLpStrb waveform, a monopulse took place during t4~t5 to be disturbed, a train pulse took place during t7~t8 to be disturbed, but disappear as long as disturb on the distance position, the Tnoise left and right sides of initial noise spot, so no matter monopulse disturbs or train pulse disturbs and can effectively be suppressed.In addition, if many control lines are interfered, the time zero of Tnoise_p or Tnoise_c should be from noise spot the earliest wherein so, and requires disappearing through disturbing after the delay of Tnoise.Time point after another kind of special circumstances occur in certain control line normal signal saltus step and postpone Tnoise if follow other impulse disturbances to take place, requires to disturb on this time point front and back position to disappear so equally.This shows, the any level saltus step that once is synchronized to Tclock that occurs on this method requirement control line, no matter be normal signal saltus step or interference saltus step, all require to disturb on the front and back position after postponing Tnoise to disappear, otherwise disturbing pulse still might be passed to follow-up IEEE1284 module.
Contrast test shows, the method that additional the present invention proposes on the anti-interference basis of conventional parallel interface is significantly improved to the inhibition ability of common control line impulse disturbances.In addition, because that the RC parameter in the control line input circuit can obtain is less, so realize message transmission rate more than the per second 1M Byte being not difficult under the ECP mode of operation.