Re: [ftdi_sio] FT232H support

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

 



Hi,

On Wed, 2011-07-13 at 10:37 +0200, Uwe Bonnes wrote:
>     Ionut> Now, one problem I see in ftdi_2232h_baud_base_to_divisor is that
>     Ionut> another bit is set (not MSB):
> 
>     Ionut> divisor |= 0x00020000;
> 
>     Ionut> I think it should be:
> 
>     Ionut> divisor |= 0x80000000;
> 
> But at 0x0001000 you have the high bit of the encoded fractional divider.
> 
> Until now, the bit at 0x0001000 and 0x00020000 are moved for devices with
> several Uarts to 0x0100000 and 0x2000000 later, so you solution would impact
> other devices.
> 
> See my solution in an earlier post in this thread.
> 

I saw your previous post now. Yes, there's 1 bit of the fractional
divider in the upper 16-bit half of the 32-bit encoded divisor. The
other two are in the lower 16-bit half so they will get into urb_value
together with the integer divisor.

I have to admit I'm a little confused about how the
FTDI_SIO_SET_BAUDRATE_REQUEST command should work:

* how do you send a 32 bit result with just one usb_control_message?
* isn't encoding the first 16-bit half into urb_index wrong? Shouldn't
urb_index contain the interface/channel number for multi-channel
devices?
* is there any documentation for this protocol (the control messages
exchanged with the device over usb)? I couldn't find any ...

I still think MSB needs to be set. If you look at their example in
AN120, section 4.4 for 38400 bps:

38,41,00,80 => divisor = 312.5, rate = 38,400

The u32 divisor is encoded as 0x80004138. This decodes to div_frac = 001
=> 0.5, div_int = 0x138 = 312. So the divisor is 312.5 from a clock of
12 Mhz. Doing the math 12000000/312.5 equals exactly 38400.

Regards,
Ionut.

--
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