Modifications

Sauter à la navigation Sauter à la recherche
722 octets ajoutés ,  19 mars 2017 à 12:45
Ligne 68 : Ligne 68 :     
== Contrôler des NeoPixels avec SPI ==
 
== Contrôler des NeoPixels avec SPI ==
One interesting use of the SPI protocol is driving the colors of WS2811/WS2812 NeoPixel addressable RGB LEDs. These LEDs don't actually use SPI to communicate, instead they have a [https://learn.adafruit.com/adafruit-neopixel-uberguide/advanced-coding#writing-your-own-library very specific self-clocked signal] for sending pixel color bits. However by using a high speed 6Mhz SPI signal we can 'oversample' the NeoPixel control signal and generate a close approximation of it from the D1 (MOSI) line of the FT232H.
+
Un des intérêt d'utiliser le protocole SPI est qu'il permet de contrôler des {{cl|487|LEDs Neopixels}} (Leds digitales RGB adressable à base de WS2811/WS2812). Ces LEDs n'utilisent pas le bus SPI pour communiquer. A la place, ces LEDs utilisent [[NeoPixel-UserGuide|un signal très spécifique réclament une grande maîtrise des temps d'émission]] pour envoyer les informations de couleur (les différents bits) des différents LEDs du ruban. Cependant, en utilisant un signal SPI à haute vitesse (6Mhz) il est possible de 'sur-échantillonner' le signal de contrôle NeoPixel et de générer une approximation suffisamment proche sur la ligne D1 (MOSI) du FT232H.
   −
Note that this method of driving NeoPixels is limited to lighting about 340 pixels at a time.  This limitation comes from the maximum amount of data that can be sent to the FT232H at one time over the USB bus, about 64 kilobytes of data.  Because we're oversampling the NeoPixel control signal each pixel actually takes 24*8 bytes of SPI data (or one byte of SPI data for every bit of pixel data).
+
{{ambox-stop|text=Cette méthode de pilotage parmet de prendre le contrôle d'un nombre limité de pixels (environ 340 pixels).}}
   −
To demonstrate lighting NeoPixels with the FT232H breakout you'll need the following parts:
+
La limitation du nombre de pixel contrôlable est fixé par la quantité maximale d'information qui peut être envoyer en une fois sur le FT232H via le bus USB. Cette limite est d'environ 64 kilobytes (Kilo Octets). Etant donné que nous faisons du sur-échantillonnage du signal de contrôle NéoPixel, chaque pixel requière 24*8 octets/bytes de donnée SPI (ou un octet/byte de donnée SPI pour chaque bit de donnée NéoPixel).
* Assembled FT232H breakout board.
  −
* NeoPixel strip, strand, matrix, etc.
  −
** Remember at most you can only light about 340 pixels.
  −
* Strong 5 volt power supply to drive the NeoPixels. 
  −
** Each pixel can take up to 60mA, so driving more than a handful of pixels can quickly add up to a few amps or more of current. '''Do not try to power more than a couple NeoPixels over the FT232H 5V line!'''
  −
* Level converter chip to convert 3.3 to 5 volts '''OR''' a power diode that can handle the full power of all the NeoPixels.
  −
** The NeoPixel control signal needs to be at least 0.7*Vcc (power supply voltage) which is just a little too high for the 3.3 volt output of the FT232H breakout. Just like [https://learn.adafruit.com/neopixels-on-raspberry-pi/wiring lighting NeoPixels with the Raspberry Pi] (''Adafruit, Anglais'') you need to either convert the control signal to 5 volts using a chip like the {{pl|1041|74AHCT125}}, or drop the NeoPixel power supply down slightly below 5 volts using a {{pl|46|power diode}}.
  −
* Jumper wires and breadboard.
     −
In this example I'm lighting a 16 pixel ring so I'll use a power diode that can handle 1 amp of currentIf you're using more than 16 NeoPixels you'll want a larger power diode, or a level converter chip.
+
Vous aurez besoin des éléments suivants pour tester l'utilisation de NeoPixel avec le breakout FT232H:
 +
* Un breakout FT232H assemblé.
 +
* Des NeoPixel (ruban, matrice, anneau, etc).<br />Rappelez vous que vous ne pouvez contrôler qu'environ 340 pixels.
 +
* Une alimentation 5 volts de qualité (bien régulée et capable de fournir le courant demandé). 
 +
** Chaque LED consomme jusqu'à 60mA (100% blanc). Cela représente vite plusieurs ampères (ou plus) si vous accumulez des Pixels. '''N'essayer pas d'alimenter plus de quelques pixels sur la lignes 5V du FT232H !'''
 +
* Une {{pl|1041|puce convertisseur de niveau logique pour convertir le signal 3.3V vers 5 volts}} '''-OU-''' Une diode de puissance capable de supporter le total du courant d'alimentation des pixels.
 +
** Le signal de contrôle NeoPixel à besoin d'atteindre au moins 0.7*Vcc (tension d'alimentation), ce qui est juste un peu supérieur au signal de sortie 3.3V (fourni par le breakout FT232H).  Exactement comme dans ce tutoriel [https://learn.adafruit.com/neopixels-on-raspberry-pi/wiring lighting NeoPixels with the Raspberry Pi] (''Adafruit, Anglais'') ou l'on converti le signal de 3.3V en 5V à l'aide d'un {{pl|1041|74AHCT125}}. L'autre option est de faire chuter la tension d'alimentation des néopixel en dessous de 5V en utilisant une {{pl|46|diode de puissance}} de sorte que le signal de commande 3.3v soit suffisant.
 +
* Des fils de connexion et breadboard.
   −
Connect the hardware as follows:
+
Dans cet exemple, nous allons éclairer un anneau NéoPixe à 16 LEDs et nous allons utiliser une diode de puissance capable de gérer un courant de 1 ampère. Si vous utilisez plus de 16 pixels, il faudra envisager une diode plus puissance (ou un convertisseur de niveau logique {{pl|1041|74AHCT125}} ).
 +
 
 +
Connectez le matériel comme suit:
 
* FT232H GND to power supply ground.
 
* FT232H GND to power supply ground.
 
* FT232H D1 (MOSI) to NeoPixel signal input.
 
* FT232H D1 (MOSI) to NeoPixel signal input.
29 917

modifications

Menu de navigation