RASP-FT232H-MPSSE-Windows

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Installation sous Windows

Il est nécessaire d'installer des logiciels spéciaux pour accéder au mode MPSSE du FT232H sous Windows. Nous allons utiliser un outil appelé "Zadig" pour remplacer le pilote FTDI du FT232H avec un pilote à base de libusb, libusb requis par libftdi. Ensuite, nous téléchargeons le binaire de libftdi que nous installerons pour y avoir accès depuis Python. Pour finir, nous installerons la bibliothèque Adafruit Python GPIO . Suivez très précisément les étapes ci-dessous pour réaliser l'installation des différents logiciels.

.

Avant de commencer, assurez vous d'avoir Python 2.7 installé sur votre machine. Vous pouvez télécharger la dernière version de Python 2.7 ici (c'est la version 2.7.8 au moment où nous écrivons ces lignes, n'importe quelle version 2.7.x devrait convenir--les version 3.x ne sont malheureusement pas encore supportés). Téléchargez l'installateur MSI correspondant à votre version de Windows, soit 32-bits ou 64-bits, puis exécutez le programme d'installation. Installez Python dans son répertoire d'installation standard, généralement C:\python27. Assurez vous d'avoir sélectionné l'option ajoutant "Python dans le system path" de sorte que vous pourrez appeler l'interpréteur depuis n'importe quelle ligne de commande (ou terminal).

Installation de libusb

Téléchargez l'outil Zadig correspondant à votre version de Windows depuis la page Zadig. Cet outil simplifie l'installation du pilote libusb pour le périphérique FT232H.

Débranchez tous les périphériques FTDI de votre ordinateur avant d'exécuter l'outil. Cela inclus les périphériques tesl qu'Arduino qui inclus un composant FTDI utilisé comme convertisseur USB vers série. Vous devez débrancher des périphériques pour être certain de ne pas accidentellement l'un d'eux et remplacer son pilote avec l'outil.

Après avoir déconnecté tous les périphériques FTDI, branchez votre breakout FT232H sur l'ordinateur... de sorte qu'il devrait être le seul périphérique FTDI connecté sur l'ordinateur.

Démarrez maintenant l'exécutable de l'outil Zadig que vous venez de télécharger (il n'est pas nécessaire d'installer le programme, Zadig est un simple exécutable). Cliquez sur le menu Options et sélectionnez l'entrée List All Devices (lister tous les périphériques) comme ci-dessous:

 
Crédit: AdaFruit Industries www.adafruit.com

La liste des périphériques devrait contenir plusieurs entrées. Sélectionnez le convertisseur USB-Série (comme présenté ci-dessous).

Note: Assurez vous d'avoir sélectionné le périphérique ayant FTDIBUS comme "Driver" (drivers) et un USB ID égal à 0403 6014!. Si vous vous trompez de périphérique, vous pourriez accidentellement désinstallé le pilote d'un autre périphérique (et le rendre inopérable).

 
Crédit: AdaFruit Industries www.adafruit.com

A droite de la flèche verte; cliquez sur les flèches haut/bas de la sélection du "driver" (pilote) pour sélectionner le pilote libusbK (comme indiqué ci-dessus).

Now click the Replace Driver button to replace the FTDI driver with the libusb-based driver. After the driver replacement finishes you can close Zadig tool.

To check that the driver was successfully replaced, open Device Manager from Control Panel or searching in the Start menu. You should see a new top level node libusbK USB Devices and the USB Serial Converter underneath it as shown below.

 
Crédit: AdaFruit Industries www.adafruit.com

If you see the libusbK node and USB serial device, move on to the next step to install libftdi.

If you don't see the libusbK node, try unplugging and plugging back in the FT232H breakout. If you still don't see the node, run Zadig tool again and follow the steps above again to make sure you replace the FTDI driver for the device with the libusbK driver.

Installation libftdi

This step will install libftdi's Python library. Carefully follow the steps below to make sure the library is installed.

Start by downloading the binary version of the libftdi library by clicking the button below. This binary is provided by the picusb USB resources project.

Unzip the archive and you should see a series of folders like below:

 
Crédit: AdaFruit Industries www.adafruit.com

We need to copy some files from libftdi into Python's package directory. Open another Explorer window and navigate to the location you installed Python earlier, typically C:\python27. Inside the Python directory navigate to the Lib > site-packages folder. Files you copy into this folder will be available globally as packages that your Python scripts can use.

From the libftdi archive folder, copy all the .DLL files from the bin folder into the Python site-packages folder, specifically:

  • bin\libftdi1.dll
  • bin\libftdipp1.dll
  • bin\libgcc_s_dw2-1.dll
  • bin\libiconv-2.dll
  • bin\libintl-8.dll
  • bin\libstdc++-6.dll
  • bin\libusb-1.0.dll

Then also copy in the files from the python2.7 folder of the libftdi archive into the Python site-packages folder:

  • python2.7\_ftdi.pyd
  • python2.7\ftdi1.py

To double check you copied in the right files, your Python site-packages folder should have at least the files below inside it (you might see other files & directories, but don't worry they can be ignored):

 
Crédit: AdaFruit Industries www.adafruit.com

That's all you need to do to install libftdi. Let's move on to install the Adafruit Python GPIO library next.

Bibliothèque Adafruit Python GPIO

Finally let's install the Adafruit Python GPIO library which will allow your Python scripts to access the MPSSE functionality of the FT232H breakout

First download an archive of the library by clicking the button below:

Unzip the contents and then open a command terminal and navigate to the directory where the library was unzipped. Execute the following command to install the library:

python setup.py install

Note if you see an error that Python can't be found then make sure you installed Python 2.7 as mentioned at the top of the page, and that it was added to your system path. Here's more details on how to manually add Python to your system path.

You should see the Python library install itself with text similar to the below:

 
Crédit: AdaFruit Industries www.adafruit.com

Now let's test if both the libftdi and Adafruit Python GPIO libraries were correctly installed. In the command terminal run Python by executing:

python

Once the Python interpretor has loaded, type the following at the >>> prompt:

import Adafruit_GPIO
import ftdi1

You should see no response from the Python interpretor after entering each command like below:

 
Crédit: AdaFruit Industries www.adafruit.com

No response from the Python interpretor is a good sign because it means Python was able to successfully load the libraries.

If you see an error message or failure after entering a command, unfortunately something went wrong with the installation of the library. Go back through the steps above and carefully check that nothing was missed. You want to make sure all the libftdi files are copied into the Python site-packages folder, and that the Adafruit Python GPIO library installed itself successfully.

Once you've confirmed Python can load the libraries, exit the Python interpretor by typing:

quit()

Congratulations, the MPSSE mode drivers and Python libraries are installed and ready to use! Move on to the next section to see how to use the MPSSE mode to access GPIO, SPI, I2C, etc.

Désinstallation de libusb

Should you ever want to disable the MPSSE mode for the FT232H and return to its serial UART mode follow the steps below.

First make sure the FT232H breakout is plugged in to the computer. Then open Device Manager and find the libusbK USB Devices node and the USB Serial Converter child of that node. Right click the device and select Uninstall as shown below:

 
Crédit: AdaFruit Industries www.adafruit.com

In the dialog that appears make sure the 'Delete the driver software for this device.' option is checked as shown below:

 
Crédit: AdaFruit Industries www.adafruit.com

Click OK and the libusb driver should be completely uninstalled for the device.

Now unplug the FT232H breakout board and go back to the Serial UART page to find the instructions for installing the Windows serial driver. Follow those instructions again and you should be set with the device acting as a USB serial UART again.



Source: Adafruit FT232H Breakout Add a serial protocol 'swiss army knife' to your computer and talk directly to devices with SPI, I2C, serial UART, GPIO's, and more!
Créé par Toni DiCola pour AdaFruit Industries.

Traduction réalisée par Meurisse D pour MCHobby.be.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com