Question: Does USB-Serial support non-standard baud rates like 10325, 946578 bits/s and so on?
Answer:
Yes. Cypress™ USB-Serial Bridge Controllers support non-standard baud rates. The Cypress USB-Serial Configuration Utility allows you to set non-standard baud rates. Please note that if a third-party serial communication utility such as Tera Term is used to configure the serial port, then the settings provided by it will overwrite the settings provided in the Cypress USB-Serial Configuration Utility. Similarly, any other custom serial configuration utility can be used to set the baud rates for the USB-Serial Device port. Cypress USB-Serial Bridge Controllers support a maximum baud rate of 3 Mbps for UART.
Support for Non-Standard Baud Rates
Although the device supports non-standard baud rates, only certain values of non-standard baud rates are supported. Only those baudrates which lie within a margin of ±5% of the numerically closest supported non-standard baud rate are allowed. The device does not support baud-rates that do not meet the above criteria.
To calculate the exact baud rate that is supported by the device, you need to perform the following baud rate calculation:
Baud Rate Calculation
Call the required baud rate “BR_RD” and the supported non-standard baud rate “BD_SD”.
Constants used in the calculation:
Table 1. OVS Values for Different Baud Rates
Required Baud Rate (BD_RD) | Oversampling Constant (OVS) |
2 Mbps < BD_RD ≤ 3 Mbps | 8 |
1.5 Mbps < BD_RD ≤ 2 Mbps | 12 |
BD_RD ≤ 1.5 M | 16 |
Here BR_RD is the baud rate required by the user.
Now you need to calculate a divisor. The divisor has two parts: the Integral Divisor and the Fractional Divisor.
Integral Divisor = Integer (48000000/ (BD_RD*OVS)) Fractional Divisor = Remainder ((Integer (48000000*32/ (BD_RD*OVS)))/ 32) Divisor = Integral Divisor + (Fractional Divisor/32) |
Using the divisor obtained from the calculation above, the supported baud rate BD_SD can be calculated as follows:
BD_SD= (PCLK)/ (Divisor *OVS) |
Difference = |BD_SD-BD_RD| %Difference = (Difference/BD_RD)*100% |
If the %Difference calculated above is ≤5%, then the required baud rate BD_RD is supported by the device without any failures.
Example Calculation
Now let us take an example where 1764393 bits/s (~1.68 Mbps) is the required Baud Rate, BD_RD.
BD_RD 1764393 lies between 2 Mbps and 3 Mbps, hence OVS = 12 (from Table 1 above).
Calculating the Divisor:
Integral Divisor = Integer (48000000/ (BD_RD*OVS)) = (48000000/1764393*12) = 2 Fractional Divisor = Remainder ((Integer (48000000*32/ (BD_RD*OVS)))/ 32) = Remainder((48000000*32/1764393*12)/32) = 8 Divisor = Integral Divisor + (Fractional Divisor/32) = 2+(8/32) = 2.25 |
Now the supported baud rate BD_SD can be calculated as follows:
BD_SD= (PCLK)/ (Divisor *OVS) BD_SD = (48000000)/ (2.25*12) = 1777777.7777 ~=1777777 bits/s |
Hence the supported baud rate BD_SD is 1777777 bits/s.
The difference between the required baud rate, BD_RD, and the supported baud rate, BD_SD:
|BD_SD-BD_RD| = |1777777-1764393| = 13384 %Difference = (13384/1764393)*100 = 0.75% |
The %Difference calculated above is well within the range of ±5%. Thus BD_RD = 1764393 bits/s is supported by the device.
Conclusion
The Cypress USB-Serial Bridge Controllers can support certain non-standard baud rates that satisfy the above specified criteria. Using the preceding method, you can easily find out if a particular baud rate will be supported by the Cypress USB-Serial Bridge Controller or not.
Attached with this article is an Excel file that you can use to find out if a particular baud rate is supported by the USB-Serial Bridge Controller Device. Enter the required baud rate against the “Enter Required Baud Rate (bits/s)” caption and the result will be displayed against the “Baud Rate Supported? (Yes/No)” caption.
Procedure for setting a Non-Standard Baud Rate through the Cypress USB-Serial Configuration Utility:
Figure 1. Setting a Non-Standard Baud Rate for a USB-Serial Device using the Cypress USB-Serial Configuration Utility