Abstract:
A system and method are described for bit rate detection in a serial data communication system, the system employing a data rate prompt of a pair of opposite value data bits which follow a series of idle bits. In a first embodiment a receiving port employs a clocked delay element and a set of data clock rates, each data clock rate being a multiple N of one of a set of established bit transmission rates, ranging from a highest expected bit rate to a lowest expected bit rate. The bit rate detection method comprises: clocking the delay element at the highest data clock rate, upon the sensing of one of the opposite value data rate prompt bits at the delay element, to step the value of the sensed bit into the delay element. After a predetermined number of data clock pulses have stepped the value of the sensed bit into the delay element, the system compares the bit value at an input to the delay element and the bit value in a bit position of the delay element. If the comparison indicates an equality of bit values, the delay element is clocked at a lower data clock rate until the comparing step indicates an inequality of bit values. At this point, the bit rate has been determined. 
     Another embodiment is also described wherein a pair of counters are substituted for the delay element.

Description:
FIELD OF THE INVENTION 
     This invention relates to the automatic detection of serial data rates, and more particularly to an improved method and apparatus for serial data rate detection which is capable of a synchronous, multichannel applications. 
     BACKGROUND OF THE INVENTION 
     In typical serial data communication systems, a desired bit rate is either user-selectable, via a switch bank or non-variable and &#34;hard-coded&#34; in the software. Many serial data communication devices have the capability of both transmitting and receiving multiple data rates. For instance, certain modems are capable of transmitting data at 19,200 bits per second, 9,600 bits per second, 4,800 bits per second, etc. When a sequence of serial bits is thus received over a communication link, the receiving port must determine the data rate of the incoming data stream so that its internal circuitry can be set to accommodate the signal flow (sometimes referred to as an &#34;autobaud&#34; process). 
     In typical serial applications, a rate identifying character (i.e. rate &#34;prompt&#34; character) is received, followed by a specified amount of guard time. This idle time permits the receiving device to configure its data rate without concern for loss of information. In many applications, the rate prompt character is positioned at the beginning of a lengthy data stream, and there is only one bit time separating it from the next character. In such systems, the task of automatic data rate determination (i.e. &#34;autobauding&#34;) is complicated if more than one serial channel must be monitored simultaneously. 
     Manufacturers of modems have standardized on the use of the characters &#34;AT&#34; as a rate prompt to determine the baud rate of a received information string. The actual characters in the AT prompt that are used for autobaud detection have a start bit whose value is zero and a succeeding bit with a value of one. Therefore, although the AT character string is commonly used as a data rate prompt, half of the characters in the standard character set have the same initial characteristics. This fact presents significant problems when a receiving port attempts to synchronize onto an incoming data stream and the AT prompt is not that which has been transmitted, but rather some other set of data characters. The result, obviously, is an erroneous autobaud determination, with a resultant loss of data. 
     A number of methods exist to detect serial data rates. Most, if not all, perform by a computer-based, software-intensive technique and are typically carried out by the main controlling element in the receiving port. In most cases, the key to rate detection is the time duration of the first bit received. This bit is known as the start bit and is characterized by the value of zero. 
     One method for achieving data rate detection is by measuring the width of the received start bit. This method requires that the data stream be initially sampled at the highest possible bit rate. Then, by counting the number of zero bits read, the data rate is determined. The algorithm for of this determination can be expressed mathematically by: 
     
         n=rate/b 
    
     where n is the number of zero bits read during the start bit, &#34;rate&#34; is the highest possible data rate, and &#34;b&#34; is the actual transmission rate of the incoming data. This algorithm is described in detail in the &#34;Microprocessor Applications Reference Book&#34;, Vol. 1, pp. 1-53 through 1-55, published by Zilog, Inc., July, 1981. 
     Despite the fact that the above-described algorithm and method have been used for years, they suffer from certain disadvantages. Due to the fact that the method is software based, it cannot autobaud reliably on more than one channel at a time. Additionally, it is known to fail due to its inability to set the data clock in time to receive bits which immediately follow the start bit. The result is lost information. Additionally, the character used for rate detection is either lost or must by synthesized when this technique is implemented. As above stated, if a character set other than AT, is received, the received character set is lost and a retransmission must occur. Finally, in all known systems which employ software-based, data rate detection, autobauding is difficult to implement at speeds greater than 19,200 bits per second. This is due to the fact that typical commercial microcontrollers execute approximately one instruction every microsecond. This renders a measurement of a 52 microsecond start bit (at 19,200 bits per second) extraordinarily difficult using current software technology. 
     Accordingly, it is an object of this invention to provide a data rate detection system and method which does not lose data during the autobaud process. 
     It is a further object of this invention to provide an autobaud system which is largely hardware based and avoids the prior software-based autobaud limitations. 
     It is still another object of this invention to provide an autobaud method wherein data immediately following the autobaud prompt can be immediately accommodated without guard a time. 
     SUMMARY OF THE INVENTION 
     A system and method are described for bit rate detection in a serial data communication system, the system employing a data rate prompt of a pair of opposite value data bits which follow a series of idle bits. In a first embodiment, a receiving port employs a clocked delay element and a set of data clock rates, each data clock rate being a multiple N of one of a set of established bit transmission rates, ranging from a highest expected bit rate to a lowest expected bit rate. The bit rate detection method comprises: clocking the delay element at the highest data clock rate upon the sensing of one of the opposite value data rate prompt bits at the delay element, to step the value of the sensed bit into the delay element. After a predetermined number of data clock pulses have stepped the value of the sensed bit into the delay element, the system compares the bit value at an input to the delay element and the bit value in a bit position of the delay element. If the comparison indicates an equality of bit values, the delay element is clocked at a lower data clock rate until the comparing step indicates an inequality of bit values. At this point, the bit rate has been determined. 
     Another embodiment is also described wherein a pair of counters are substituted for the delay element. 
    
    
     DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a bit chart and waveform diagram showing bits employed in the AT prompt protocol. 
     FIG. 2 is a block diagram of the bit rate detection invention. 
     FIG. 3 is a high level flow diagram of a program employed during the operation of the invention of FIG. 2. 
     FIG. 4(a) illustrates a delay element as a start bit arrives at its input. 
     FIG. 4(b) illustrates the delay element after the start bit has been shifted using the highest data rate clock. 
     FIG. 5(a) illustrates the delay element when a lower data rate signal is received at its input. 
     FIG. 5(b) shows the state of the delay element after 24 shifts, employing the highest data rate clock. 
     FIG. 6(a) shows the delay element as the shift rate is reduced to a next lower data rate clock. 
     FIG. 6(b) illustrates the delay element and the conditions which exist to enable an output indicating that the proper bit rate has been determined. 
     FIG. 7 is a block diagram of further embodiment of the invention 
     FIG. 8 is a block diagram of a still further embodiment of the invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring now to FIG. 1, a received bit stream 10 is illustrated proceeding in a rightward direction in the drawing. Initially, a series of idle one bits are received indicating that no information is being transmitted. The data level received during the idle bit time is illustrated by portion 12 of waveform 13. As aforestated, the data communications industry has largely accepted the AT character string as a prompt for determining the baud rate of a received information character string. The characters are indicated in hexadecimal and, as can be seen in FIG. 1, A=01000001 and T=01010100. Each character is preceded by a zero level start bit and is terminated by a one level stop bit. As indicated in the introduction to this specification, baud rates have been determined heretofore by detecting the width of the zero level start bit and converting that width into a baud rate. As will be seen hereinafter, this invention employs a hardware-based system which employs a different algorithm to automatically determine the data rate. 
     Referring now to the embodiment shown in FIG. 2, serial data is received at a port 20 and is fed to a multi-position delay element 22. A system clock signal is applied via input 24 to a data rate clock generator 26. Data rate clock generator 26 provides a plurality of outputs, each output evidencing a multiple of one of a plurality of expected bit rates. It continuously generates a plurality of data rate clock outputs, each data rate clock output being a multiple N of an expected bit rate. For instance, assuming N=16, output line 28 will have continuously applied thereto a frequency which is 16×19,200 bits per second (the highest expected baud rate). The same multiplier will be used on output lines 30, 32, 34, and 36 for bit rates of 9,600 bits per second, 4,800 bits per second, 2,400 bits per second and 1,200 bits per second, respectively. 
     Each output from data rate clock generator 26 is applied to a set of gates 40, each of whose open or closed state is controlled via line 42 from microprocessor 44. A selected data rate clock from generator 26 is thus gated by gates 40 and is applied, via line 46, to both microprocessor 44 and as a stepping input to delay element 22 via line 48. The data rate clock signal is also applied via line 50 to a synchronous receiver/transmitter 52. 
     In addition to input serial data being applied via port 20 to delay element 22, it is also applied, via line 54 to microprocessor 44 and as one input to exclusive OR circuit 56. Another input to exclusive OR circuit 56 is applied via line 60 from the last stage 58 of delay element 22. As will be understood, an output from exclusive OR circuit 56 is the signal which indicates that the data rate of an incoming signal has been determined. That indication is applied to microprocessor 44 via line 62. A broad-side, read-in register 64 is employed to both reset delay element 22 and, to force one bits into certain of its stages upon a determination being made that a bit rate has not been properly determined. The controls for broad-side read-in register 64 are fed from microprocessor 44 via lines 66 and 68 respectively. Line 69 connects microprocessor 44 to a system processor which both collects the incoming data and controls the overall operation of the data rate detection apparatus. It should be understood that microprocessor 44 can be a dedicated, software-controlled processor or it can be replaced by a hard-wired logic state machine. The term microprocessor will be used herein to generically refer to both types of equipment. 
     Delay element 22 is preferably a multistage, serial shift register capable of being clocked at a multiple N of the highest expected bit rate. While a multiplier of 16 will be hereinafter employed for this description, it should be understood that other multipliers are also acceptable. Using a 16 times multiplier, the data rate clock at 19.2 kbits per second is 307.2 kHz (one pulse per every 3.26 microseconds). Delay element 22 is provided with a sufficient number of stages so that its length is equal to 1.5 bit periods at the highest expected input bit rate. Thus, assuming N=16, delay element 22 is provided with 24 serially connected stages. The shift stages, over and above 16, enable the delay element to accommodate incoming bits whose width varies by as much as +50% over an expected bit duration. 
     Referring now to FIG. 3, the algorithm employed by microprocessor 44 to determine the incoming bit rate will be described. In summary, microprocessor 44 &#34;looks for&#34; a high (&#34;one&#34;) output from exclusive OR 56 when the leading edge of a start bit is shifted into stage 58 in delay element 22. The high output from exclusive OR 56 indicates that the zero start bit is totally within the confines of delay element 22; and that the initial one bit in the &#34;A&#34; prompt has arrived and is being shifted into element 22. This condition provides differing inputs to exclusive OR 56 causing it&#39;s output to rise to the high level. If exclusive 0R 56 does not manifest a high output when the leading edge of the new level start bit arrives at stage 58, then microprocessor 44 gates a next lower data rate clock to delay element 22 and repeats the process. 
     In FIG. 3, the algorithm for data rate determination employed by microprocessor 44 is shown. Box 100 illustrates that a series of initialization steps occur as follows: asynchronous receiver transmitter 52 receives no data rate clock signal ; the pulse width measurement routine is activated in microprocessor 44 causing it to monitor incoming serial data arriving at port 20 for a series of idle time one bits; and microprocessor 44 causes a broad-side read-in of ones into all stages of delay element 22 from register 64. 
     As shown in decision box 102, microprocessor 44 continues to examine the incoming bit stream, all the while looking for a one-to-zero transition indicating a change from a one level idle bit to a zero level start bit (see FIG. 1). If no such level transition is seen, the monitoring status is continued. If a one-to-zero transition is sensed, microprocessor 44, via line 42, enables gates 40 to place on line 46, the highest data rate clock. In this case, it is assumed that the highest data rate is 19.2 kbits per second and since the data rate clock generator is providing 16 pulses per data bit, the effective clock rate applied to line 46 is 307.2 kHz. Those clock pulses are both applied as stepping signals to delay element 22 via conductor 48, and also to microprocessor 44 which maintains a running pulse count. The applied clock pulses cause the incoming start pulse zero level to be stepped into succeeding stages of delay element 22, with 24 clock pulses causing the zero level leading edge of the start pulse to arrive at stage 58. 
     An example helpful in understanding the operation of this invention is shown in FIGS. 4(a) and 4(b). There, delay element 22 and exclusive OR 56 are shown, along with their operational interconnections. Assuming a 19.2 kbit per second start pulse is received, that pulse approximately is 52 microseconds long. As aforestated, initially, delay element 22 has ones forced into all of its stages (see FIG. 4(a)). While a high output from exclusive OR 56 indicates to microprocessor 44 that a proper bit rate has been detected, such an indication is only valid when the start pulse level reaches stage 58. Therefore, microprocessor 44 is programmed to ignore exclusive 0R 56 until the leading edge of the start pulse is manifested at shift stage 58. 
     The shift rate of data into delay element 22, when a 307.2 kHz pulse rate is applied, is 3.26 microseconds shift. Thus, as shown in FIG. 4(b), after 24 shifts the start pulse has moved as shown and its leading edge value is now present in stage 58. In addition, the lagging edge of the start pulse has also been shifted into delay element 22 along with a portion of the following initial one bit of the &#34;A&#34;. At this time, the inputs to exclusive OR 56 are, respectively, zero on line 60 and one on line 54, causing a high output to be passed to microprocessor 44. This situation indicates that a 19.2 kbit per second start pulse has, in fact, been received and that the applied data rate clock is appropriate. 
     If, on the other hand, a 9.6 kbit per second start pulse had been received, the situation would be as shown in FIGS. 5(a) and 5(b). The duration of a start pulse at 9.6 kbits per second is 104 microseconds. Thus, with 3.2 microseconds per shift, only 78 microseconds of the 104 microsecond start pulse would have been shifted into delay element 22 when the leading edge of the start pulse arrives at stage 58. Now, when the output of exclusive OR 56 is examined by microprocessor 44, it finds a down level due to the fact that the level at input port 20 is the same down level as appears in stage 58. It can be seen from FIG. 5(b), that at this time, 26 microseconds of the start pulse remains to be shifted into delay element 22. 
     Returning to FIG. 3, the algorithm, after determining that 24 shifts have occurred in delay element 22 (decision box 106), determines whether the input level to delay element 22 is equal to the 24th bit position level (decision box 108). If they are the same, e.g.. see FIG. 5(b), microprocessor 44 recognizes that the data rate clock is set too high. In such case (box 110), microprocessor 44 controls gates 40 to apply the next lower data rate clock onto line 46 (see FIG. 2). Simultaneously, microprocessor 44, via line 68, forces broad-side, read-in register 64 to read ones into the last eight stages of delay element 22. The output of exclusive OR 56 is ignored for the time being. The results of the above actions are shown in FIG. 6(a). The newly applied lower data rate clock is 153.6 kHz (16 times 9.6 kbits per second), and the last eight stages of element 22 manifest one states. The applied 153.6 kHz data rate clock steps delay element 22 every 6.52 microseconds. Thus the portion of the start pulse in the first 16 stages of delay element 22 has an effective time length of 78 microseconds and the last eight stages have an effective time length of 52.16 microseconds. Since only 26 microseconds of the start pulse remain to be stepped into delay element 22, it can be seen, as shown in FIG. 6(b), that after 8 shifts, the leading edge of the start pulse arrives at stage 58 and its lagging edge is also within the delay element 22. Therefore, when microprocessor 44 is now enabled to examine the output of exclusive OR 56 and finds a high level manifested, it knows that a proper data rate clock is being generated. 
     Referring back to FIG. 3, the above described portion of the algorithm is shown by decision box 114. After eight shifts, the output of exclusive OR 56 is examined (decision box 108) and the process is repeated. However, in this case, exclusive OR 56, by providing the high output indicates that the level at the input to delay element 22 is not equal to the level in stage 58 so the program branches to decision box 116. Here, even though it is assumed that the proper data rate clock is now being generated, there are still a number of alphanumerics which may be received which have similar leading data bits as the &#34;AT&#34; prompt. Microprocessor 44 follows the data rate clock determination by determining that an &#34;A&#34; prompt has actually been received. This is accomplished by sensing the succeeding bits after the start bit to determine if a proper hexadecimal A follows. If such is found to be the case, the program exits, now knowing the proper data rate clock is being applied. If, on the other hand, it is determined that an A has not been received, the entire procedure aborts and reinitializes to await the next start bit. 
     From the above, it can be seen that the data rate clock generator &#34;ratchets&#34; downwardly until the proper data rate clock is determined. At no time is the incoming start bit lost as each time the data rate clock proceeds to a lower clock rate, the start bit is, in essence, reconstituted at a slower data rate. Thus, it can be seen that no data is discarded during the process of data clock rate determination and that the system &#34;autobauds&#34; automatically. 
     Referring now to FIG. 7, a block diagram is shown of a further embodiment of the invention. This circuit avoids the need for shifting of data through multiple delay stages, and instead, employs a pair of counters to both delay the incoming data and measure the duration of the start bit. Circuit elements shown in FIG. 7 which are common to the embodiment of FIG. 2 are similarly numbered. Counters 100 and 102 are both five bit counters and are connected to the data-in port 20. Additionally, the signals appearing at data-in port 20 are applied to decode logic circuits 104 and 106 respectively. Microprocessor 44 provides an enable/not enable control signal via line 108 to decode logic circuits 104 and 106 and data rate clock generator 26. 
     The selected data rate clock output from gates 40 is applied via conductor 48 to counters 100 and 102 and serves to step them through their various states. Outputs from decode logic circuits 104 and 106 are respectively applied via lines 118 and 120 to reset and set inputs of a data latch 110. Further, decode logic circuits 104 and 106 provide state indications via lines 112 and 114 to microprocessor 44. 
     As will be hereinafter understood, counter 100 measures the start bit duration and, additionally, delays any falling edge of an incoming data pulse by 20 clock cycles. Counter 102 is employed to delay any rising edge of a data signal by 20 clock cycles. 
     Initially, it is assumed that idle bits are present at data-in port 20 and thus, high input levels are applied to decode logic circuits 104 and 106. At this time, microprocessor 44 has issued, via line 108, an enable indication to both decode logics 104 and 106 with the enable signal causing counter 100 to be prepared to count. That enable signal, in combination with the high data level appearing at port 20, causes decode logic circuit 106 to de-enable counter 102. Additionally, decode logic 106 issues a set indication to data latch 110 thereby causing its output on line 116 to be high, indicating a high input level at data-in port 20. 
     So long as the data-in level at port 20 remains high, nothing happens. When however, the data-in level falls, counter 100 commences counting and a start-bit search sequence is commenced. It will be recalled that at 19,200 bits per second, a nominal start pulse is 52 microseconds long. Furthermore, industry standards require that if the start pulse varies by as much as ±/-25%, that it is still to be recognized as a start pulse. 
     At the outset of the data rate search, gates 40 provide the highest data rate clock (19,200 bits per second×16) via line 48 to counters 100 and 102. Since a multiplier of 16 is employed to produce the data rate clock signal, it can be understood that each counter will provide 16 counts during the nominal duration of a start pulse (or any data pulse). Accordingly, a count of 12 will indicate a pulse which is at the lower edge of the allowed time duration (-25%) and a count of 19 will indicate a pulse duration at the upper limit of the pulse duration (+25%). Accordingly, if the data-in level on port 20 goes high while counter 100 indicates a count of 11 or less, decode logic 104 concludes that the bit duration is too short to be a start pulse at 19,200 bits per second. As a result, the search aborts. 
     If the level at data-in port 20 is still low at the 20th count, the pulse width is too long to be a start bit at 19,200 bits per second. Accordingly, decode logic 104 issues an indication via line 112 to microprocessor 44 which, in turn, causes gates 40 to place the next lower data rate clock onto line 48 (16×9,600 bits per second). At the same time, decode logic 104 presets counter 100 to a count of 10 as that is the count which would be indicated by counter 100 had it started at the beginning of start pulse at 9,600 bits per second. (It will be recalled that 9,600 bits per second is 50% of 19,200 bits per second and this equates to 50% of the count of 20 being 10). This results in counter 100 being set as though it had been counting at 16×9,600 bits per second from the commencement of the negative going excursion of the start pulse. 
     Again, decode logic 104 looks for a combined high data-in level at port 20 and a count emanating from counter 100 between counts 12 and 19. If such a combined state occurs, a valid start pulse has been received at 9,600 bits per second. Nevertheless, counter 100 continues to count until it reaches a count of 20. At this point, a valid start bit indication is issued to microprocessor 44 via line 112 and an output is supplied via line 118 to reset data latch 110 to the low state. The result of that reset action is to set the state of data latch 110 to the input state of the data which occurred 20 counts ago, thus enabling the data state at data-in port 20 to be established in a delayed mode. 
     Counter 102 comes into action when counter 100 determines that a proper start bit has been received. In specific, it immediately commences counting when a high level appears at data-in port 20 and counter 100 manifests a count between 12 and 19. It should be recalled that counter 102 is solely employed to determine the rising edge of data signals and to delay each rising edge by 20 counts. Counter 102 continues its count until it reaches 20, at which point decode logic 106 issues a set signal on line 120 to data latch 110. As a result, the output on line 116 rises indicating a first one bit of the A prompt. If, for some reason, the level at data-in port 20 falls before counter 102 reaches a count of 9, an abort occurs due to the fact that the subsequently received signal is too short to be a valid data pulse. 
     When counter 100 reaches a count of 20 it is automatically reset to a count of 0 to await the next negative going excursion at data-in port 20. When that data-in excursion occurs, as aforestated, decode logic 104 does not issue a reset signal to data latch 110 until counter 100 reaches a count of 20. In this manner, input data signals are thereby preserved, but delayed by a count of 20 clock pulses. 
     If the procedure, as above indicated for data rate determination, is not successful at 9,600 bits per second, the system continues to ratchet down to lower data rate clocks until an appropriate start bit duration is determined. 
     In the above description, while the data rate clock divisions are shown as being 50%, other non-integer divisions could be employed. However, this would require correspondingly different data rate clocks and an adjustment of the length of either the delay element or the counts indicated by counters 100 and 102. 
     Turning now to FIG. 8, another embodiment of the invention is shown wherein a &#34;long counter&#34; 200 is employed along with delay element 22. The outputs from counter 200 are applied to decode logic circuit 202. The remaining portions of the circuit are as shown in FIG. 2. Instead of monitoring the various output points from delay element 22 as shown in FIG. 2, counter 200 is clocked at the highest clock rate (16× 19,200) when the initial low level is sensed at data-in port 20. Counter 200 is 9 bits long and its various output states indicate the rate of the input data. 
     When data-in goes low, counter 200 commences counting. If data-in traverses to the high state in the range of 12 to 19 counts, then a 19,200 bit per second start bit has been sensed. If data-in has not traversed to the high state by count 20, then decode logic 202 issues to microprocessor 44 a command to reduce the data rate clock applied to delay element 22 to the next lower data rate clock. In this circuit however, the highest data rate clock continues to be applied to counter 200 via conductor 206. Additionally, before the next lower data rate clock begins stepping delay element 22, its the latter half is loaded with ones. 
     If the data-in level traverses to the high state between counts 24 and 40 then a 9,600 bit per second level has been found. If the data-in level is not at the high state by count 40, then the data rate clock input to delay element 22 is again changed to the next lower data rate clock and ones are again preloaded into the latter half stages of element 22. The same procedure continues, and if data-in traverses to the high state between counts 48 and 80 then a 4,800 bit per second start level is determined etc. (e.g., If the data-in level traverses to the high state between counts 96 and 160, then a 2,400 bit per second start bit has been determined.) 
     It should be understood that the aforegoing description is only illustrative of the invention. Various alternatives and modifications can be devised by those skilled in the art without departing from the invention. Accordingly, the present invention is intended to embrace all such alternatives, modifications, and variances which fall within the scope of the intended claims.