FT232H baud rate calcuilation, was: FT232H support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <1310393182.8617.16.camel@AlexS-PC> you wrote:
> Hello,

> We are currently working with a development module which contains a
> FT232H chip and communicates via UART with another chip at a baud rate
> of exactly 115200. After the last patch of the ftdi_sio driver we saw
> that, theoretically, the FT232H should be fully supported by the driver.
> But, when we tried to use it, it didn't work. 

Argh: So my loop back test wasn't sufficent.

> After digging further, we got to the 'get_ftdi_divisor()' function where
> the FT232H chip was placed on the same branch as FT2232H and FT4232H
> and, for a baud rate of 115200, 0xC068 was calculated as the divisor,
> when the correct value should have been 0x1A. The latter being confirmed
> by both the application note (AN120 from FTDI [1]) and the
> 'ftdi_set_baudrate()' in libftdi. On the other side, the
> 'ftdi_232bm_baud_to_divisor()', used for the FT232BM, FT2232C and
> FT232RL appears to also return the correct divisor for FT232H. 

Up to 3.000.000 Baud, FT232BM, FT2232C, FT232RL, FT2232H, FT4232H and FT232H
(should) calculate the baud rate the same way.

> Basically, we have 2 issues that aren't really clear:
> 1) Is the FT232H placed in the correct branch when calculating the
> divisor?

There are some issues withe the 2/3232H baud rate calculation, see the
archive of the list

> 2) What't the explanation behind the algorithm which calculates the
> divisor in function "ftdi_2232h_baud_base_to_divisor()"  ?

For the FT232R, the data sheet states for baud rate calculation:
Baud Rate Generator 
- The Baud Rate Generator provides a 16x clock input to
the UART Controller from the 48MHz reference clock. It consists of a 14 bit
pre-scaler and 3 register bits which provide fine tuning of the baud rate
(used to divide by a number plus a fraction or
a "sub-integer"). This determines the baud rate of the UART,
which is programmable from 183 baud to 3 Mbaud.  The FT232R supports all
standard baud rates and non-standard baud rates from 183 Baud up to 3
Mbaud. Achievable non-standard baud rates are calculated as follows - Baud
Rate = 3000000 / (n + x) where 'n' can be any integer
between 2 and 16,384 ( = 2 ) and 'x' can be a sub-integer of
the value 0, 14 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, or 0.875. When n = 1,
x = 0, i.e. baud rate divisors with values between 1 and 2 are not possible.

The FT2/4232H has:
Independent Baud Rate Generators 
- The Rate Generators provides
a x16 or a x10 clock input to the UART'ss from a 120MHz reference
clock and consists of a 14 bit pre-scaler and 4 register bits which provide
fine tuning of the baud rate (used to divide by a number plus a
fraction). This determines the Baud Rate of the UART which is programmable
from 183 baud to 12 million baud. The FT2232H does not support the baud
rates of 7 Mbaud 9 Mbaud, 10 Mbaud and 11 Mbaud.

And the FT232H:
Baud Rate Generators
- The Baud Rate Generators provides a x16 or a x10 clock input to the UART's
 from a 120MHz reference clock and consists of a 14 bit pre-scaler and 4
 register bits which provide fine tuning of the baud rate (used to divide by
 a number plus a fraction). This determines the Baud Rate of the UART which
 is programmable from 183 baud to 12 Mbaud. See FTDI application note AN_120
 on the FTDI website for more details.

This makes me confident with placing the FT232H into the FT2232H/FT4232H
baud rate calculation path.

I guess there is still something fishy with the Baud rate calculation...

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux