USB対応マイコンによるFTDI素子とのUSB通信

こんにちは。

Synergy (又はルネサスのUSB機能実装マイコン)で FTDI 素子を用いた機器と

通信を行いたいのですが、データの送受信を実現された方はいらっしゃいますでしょうか?

現在確認しているのは、

 CDCのClass Request(UX_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING)は非対応である。

   非対応である為、上記関数を使用してボーレートやビットレートの設定は出来ない。

   従って、CDCドライバを使用して、FTDIデバイスを使用したUSB機器とデータのやり取りが出来ない。 

実現された方は、どのように対応されたのか、教えて頂けないでしょうか?

また、こうすればいいのではというご意見あれば教えて下さい。

是非、皆様のお知恵をかしてください。

よろしくお願い致します。

Parents
  • えん さん、こんにちは。NoMaYです。

    > ボーレートを設定しているコマンドは頂いているURLのヘッダファイルから推測可能なのでしょうか?

    ボーレートに関してはyamayamaさんが提示して下さっていたもう一方の以下の2つ目のURLも関係していますよ。uClinux-H8のヘッダファイル単独では分かりにくい部分をこれで補うことが出来るよ、という意図で提示して下さっていたのだと思います。

    uClinux-H8のヘッダファイルの1つ (yamayamaさんが提示されていた先ほどのURLです)
    osdn.net/projects/uclinux-h8/scm/git/linux/blobs/master/drivers/usb/serial/ftdi_sio.h

    /*
     * BmRequestType:  0100 0000B
     * bRequest:       FTDI_SIO_SET_BAUDRATE
     * wValue:         BaudDivisor value - see below
     * wIndex:         Port
     * wLength:        0
     * Data:           None
     * The BaudDivisor values are calculated as follows:
     * - BaseClock is either 12000000 or 48000000 depending on the device.
     *   FIXME: I wish I knew how to detect old chips to select proper base clock!
     * - BaudDivisor is a fixed point number encoded in a funny way.
    。。。以後省略。。。

    AN232B-05 Configuring FT232R, FT2232 and FT232B Baud Rates (yamayamaさんが提示されていたもう一方のURLです)
    www.ftdichip.com/Support/Documents/AppNotes/AN232B-05_BaudRates.pdf

    1.3 Baud Rate Calculation
    A Baud rate for the FT232R, FT2232 (UART mode) or FT232B is generated using the chips
    internal 48MHz clock. This is input to Baud rate generator circuitry where it is then divided by 16
    and fed into a prescaler as a 3MHz reference clock. This 3MHz reference clock is then divided
    down to provide the required Baud rate for the device's on chip UART. The value of the Baud rate
    divisor is an integer plus a sub-integer prescaler. The original FT8U232AM only allowed 3 subinteger
    prescalers - 0.125, 0.25 or 0.5. The FT232R, FT2232 (UART mode) and FT232B support
    a further 4 additional sub-integer prescalers - 0.375, 0.625, 0.75, and 0.875. Thus, allowed values
    for the Baud rate divisor are:
    Divisor = n + 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875; where n is an integer between 2 and
    16384 (214).
    。。。以後省略。。。

     

Reply
  • えん さん、こんにちは。NoMaYです。

    > ボーレートを設定しているコマンドは頂いているURLのヘッダファイルから推測可能なのでしょうか?

    ボーレートに関してはyamayamaさんが提示して下さっていたもう一方の以下の2つ目のURLも関係していますよ。uClinux-H8のヘッダファイル単独では分かりにくい部分をこれで補うことが出来るよ、という意図で提示して下さっていたのだと思います。

    uClinux-H8のヘッダファイルの1つ (yamayamaさんが提示されていた先ほどのURLです)
    osdn.net/projects/uclinux-h8/scm/git/linux/blobs/master/drivers/usb/serial/ftdi_sio.h

    /*
     * BmRequestType:  0100 0000B
     * bRequest:       FTDI_SIO_SET_BAUDRATE
     * wValue:         BaudDivisor value - see below
     * wIndex:         Port
     * wLength:        0
     * Data:           None
     * The BaudDivisor values are calculated as follows:
     * - BaseClock is either 12000000 or 48000000 depending on the device.
     *   FIXME: I wish I knew how to detect old chips to select proper base clock!
     * - BaudDivisor is a fixed point number encoded in a funny way.
    。。。以後省略。。。

    AN232B-05 Configuring FT232R, FT2232 and FT232B Baud Rates (yamayamaさんが提示されていたもう一方のURLです)
    www.ftdichip.com/Support/Documents/AppNotes/AN232B-05_BaudRates.pdf

    1.3 Baud Rate Calculation
    A Baud rate for the FT232R, FT2232 (UART mode) or FT232B is generated using the chips
    internal 48MHz clock. This is input to Baud rate generator circuitry where it is then divided by 16
    and fed into a prescaler as a 3MHz reference clock. This 3MHz reference clock is then divided
    down to provide the required Baud rate for the device's on chip UART. The value of the Baud rate
    divisor is an integer plus a sub-integer prescaler. The original FT8U232AM only allowed 3 subinteger
    prescalers - 0.125, 0.25 or 0.5. The FT232R, FT2232 (UART mode) and FT232B support
    a further 4 additional sub-integer prescalers - 0.375, 0.625, 0.75, and 0.875. Thus, allowed values
    for the Baud rate divisor are:
    Divisor = n + 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875; where n is an integer between 2 and
    16384 (214).
    。。。以後省略。。。

     

Children
No Data