|
This Application Note is intended to provide information to determine when the CTS (Clear-To-Send) signal should be used. Need for Clear-To-Send depends on RS-232 character rates and character data patterns. Maximum character rates are a function of the baud rate. From this data, you can determine maximum burst sizes that can be sent to Vetra's USB-331 and USB-335 Serial ASCII to USB keyboard code converters without using the Clear-To-Send signal.
The Clear-To-Send signal advises the data source that data should be throttled to prevent data overrun
The USB?331 and USB-335 models will be referred to as the "USB-331" in the rest of this note, since the information provided here applies equally to both models.
Please note that "character rate" and "baud rate" are not the same. "Baud rate" is the bit rate of the RS-232 signal. "Character rate" is the number of 8-bit bytes, or characters, that are sent in one second to the USB-331. Note that at any given baud rate, characters may be sent at slower rates than the possible maximum.
Standard and Extra Speed Options
Vetra's USB-331 has two conversion speed options, standard and Extra Speed. When the standard speed option is selected, the USB-331 appears to the host PC like a standard USB keyboard. All applications that support an USB keyboard, should accept USB keyboard data converted from ASCII by the USB-331.
When the Extra Speed Option is selected, the USB-331 converts ASCII data to USB keyboard codes four times faster than an USB keyboard. Most applications can handle data at such a speed. If problems are encountered, standard speed should be selected.
Information applicable to both speeds is provided in this note.
Background
The USB-331 accepts ten-bit data, consisting of one start bit, eight data bits representing the ASCII character, and one stop bit. This gives the maximum possible character rate as 1/10 of the baud rate. In such a case, there is no break between the ASCII data characters. If a break exists between the incoming serial ASCII characters, the character rate is slower than the maximum for that baud rate.
The pattern of incoming characters affects data throughput. Two factors are important here. First is sequence of identical characters following one another. An example of identical characters in sequence is 1111aaaa, where four 1's are in sequence followed by four a's. On the other hand, the sequence 1234abcd has no sequential identical characters. The second factor is character case (shifted or unshifted). The last example was a sequence with all unshifted characters (for the US English keyboard layout). An example of a sequence with changing case is the sequence aBcDeF.
Sequences of identical characters reduce the effective throughput rate. The fastest conversion rates are achieved with all different character strings. The slowest conversion rate exists when 12 or more characters in a string are identical. Sequences with two to eleven identical characters have conversion rates between the fastest and slowest.
In contrast, changing shift/no shift sequences reduce the effective throughput rate. The fastest conversion rates are achieved when the character in the strings have an identical shift case, either all shifted or all unshifted. The slowest conversion rate exists when there are 12 or more characters in a row each with a different shift case. Sequences with two to eleven shift case changes have conversion rates between the fastest and slowest.
The need for the Clear-To-Send (CTS) signal is present when the conversion rate for a given incoming data pattern is slower than the incoming character rate.
The USB-331 has internal buffering and will store a number of characters when the conversion rate is slower than the incoming character rate. The number of characters stored depends on the conversion rate and the incoming character rate. It is called "burst size", or "burst" in this note.
Tables of burst size limits for the fastest incoming character rate and for various data patterns are given in the next paragraph. For cases where the incoming character rate is slower than the maximum, a formula to estimate burst size is given.
Maximum Character Rates and Burst Sizes
The two tables below gives burst size limits for standard and Extra Speed options for a number of incoming character rates, RIN, and data patterns. "N" in the tables denotes the number of identical characters in a string, "1" designating no identical characters. It also denotes the number of sequential shift case changes, with "1" designating no changes, and so on. Effectively, N-1 indicates the number of sequential shift case changes.
If your incoming data string is larger than the limit given in the tables, you need to connect and use the Clear-To-Send (CTS) signal, or move to a slower RIN character rate.
BAUD RATE |
Max RIN ch/sec |
BURST SIZE LIMIT AT N = | ||||||||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | >12 | ||
19200 | 1920 | None | 320 | 146 | 114 | 100 | 94 | 90 | 86 | 84 | 82 | 80 | 80 | 80 |
9600 | 960 | None | None | None | 320 | 186 | 146 | 126 | 114 | 106 | 100 | 96 | 94 | 94 |
4800 | 480 | None | None | None | None | None | None | 652 | 320 | 228 | 186 | 162 | 146 | 146 |
2400 | 240 | None | None | None | None | None | None | None | None | None | None | None | None | None |
1200 | 120 | None | None | None | None | None | None | None | None | None | None | None | None | None |
300 | 30 | None | None | None | None | None | None | None | None | None | None | None | None | None |
"None" means data can be sent
continuously.
Character rate at which burst size has no limit is 250 characters/sec,
or slower, at Extra Speed.
BAUD RATE |
Max RIN ch/sec |
BURST SIZE LIMIT AT N = | ||||||||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | >12 | ||
19200 | 1920 | 114 | 86 | 80 | 76 | 74 | 74 | 74 | 72 | 72 | 72 | 72 | 72 | 72 |
9600 | 960 | 320 | 114 | 94 | 86 | 82 | 80 | 78 | 76 | 76 | 74 | 74 | 74 | 74 |
4800 | 480 | None | 320 | 146 | 114 | 100 | 94 | 90 | 86 | 84 | 82 | 80 | 80 | 80 |
2400 | 240 | None | None | None | 320 | 186 | 146 | 126 | 114 | 106 | 100 | 96 | 94 | 94 |
1200 | 120 | None | None | None | None | None | None | 652 | 320 | 228 | 186 | 162 | 146 | 146 |
300 | 30 | None | None | None | None | None | None | None | None | None | None | None | None | None |
"None" means data can be sent
continuously.
Character rate at which burst size has no limit is 62.5 characters/sec,
or slower, at Standard Speed.
If your incoming character rate is not in the tables above, you
can estimate the burst size limit by using the formula below.
First, determine if you have a burst size limit. RIN is your incoming character rate in characters/sec.
If (RMAX/N) >= RIN, where RMAX = 3000 for Extra Speed, = 750 for standard speed, burst size is unlimited, that is, a continuous stream can be presented.
If (RMAX/N) < RIN, Burst size limit is determined by the formula:
BURST=FLOOR((70*RIN)/(RIN-(RMAX/N))),
Where
FLOOR indicates round down,
RMAX = 3000 for Extra Speed Option, = 750 for standard speed option
RIN is the character rate in characters/sec,
N is:
a) The number of consecutive identical characters in the incoming
data stream, where N=1 signifies all characters are different,
N=2 signifies that two characters are identical, etc. N=12 is
the maximum; the same burst limits apply to sequences with more
than 12 identical characters as to 12; or
b) N-1 is the number of sequential shift case changes, with "1"
designating no changes, "2" one change, and so on.
For instance, the burst limit for standard speed at 19,200 baud and a character rate of 1200 ch/sec (less than the possible maximum of 1920), with N=2 is:
BURST=FLOOR((70*1200)/(1200-(750/2))
= FLOOR(84,000/825) = FLOOR(101.81) = 101 characters.
Summary
The information
in this note is intended to assist you in determining if you need
to connect the Clear-To-Send (CTS) signal. There are other factors
that determine effective throughput, such as the host platform,
both hardware and software, that is the target of the data. The
system and application receiving the data may not support the
data rates possible with the USB-331, and you may have to reduce
the incoming character rate and/or the burst size.
The Vetra USB-331 and USB-335
Protocol Converters use technology covered by US Patent 7,299,309
Copyright © 2009 by Vetra Systems Corporation. All rights
reserved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 Marcus Blvd. Ste-J Hauppauge, NY 11788-2022 USA Tel: 631-434-3185 Fax: 631-434-3516 e-mail: sales@vetra.com |