Arduino Yun-Présentation

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.

Aperçu

Arduino-Yun-Pres01.jpg
Crédit: Arduino arduino.cc

Arduino Yún est un microcontrôleur basé sur une ATmega32u4 (fiche technique) et un Atheros AR9331. Le processeur Atheros supporte une distribution Linux basée sur OpenWRT et se nommant Linino. La carte dispose d'un support Ethernet et Wifi intégré, un port a USB-A, un emplacement pour carte micro-SD, 20 broches d'entrées/sorties digitales (dont 7 peuvent être utilisées en sortie PWM et 12 comme entrée analogique), une horloge 16 MHz, une connexion micro USB, un connecteur ICSP et 3 boutons resets.

Note: dans certains pays, il n'est pas autorisé de vendre du matériel disposant d'une connexion Wifi active sans certification gouvernementale. Si vous voulez désactiver le Wifi alors exécutez ce sketch/croquis]. Référez vous à ce fil de discussion pour plus d'information.

Arduino-Yun-Pres02.jpg
Crédit: Arduino arduino.cc

Yún se différencie des autres carte Arduino par le fait qu'il communique avec la distribution Linux de la carte, offrant ainsi la puissance d'un ordinateur connecté au réseau avec la facilité d'utilisation d'un Arduino. En plus des commandes Linux tel que cURL, vous pouvez écrire vos propres scripts Shell et Python pour réaliser de interactions robustes.

Le Yún est similaire à Léonardo en ce sens que l'ATmega32u4 dispose de la communication USB intégrée, éliminant ainsi le besoin d'un second processeur. Cela permet au Yun d’apparaitre connecté comme un clavier ou une souris, en plus du port COM Série/(CDC) virtuel.

Arduino-Yun-Pres03.jpg
Crédit: Arduino arduino.cc Traduction par MCHobby.be

La librairie "Bridge" (librairie "pont" de liaison) facilite la communication entre les deux processeurs, permettant au sketch Arduino d'exécuter des scripts Shell, communiquer avec les interfaces réseaux et recevoir des informations depuis le processeur AR9331. L'hôte USB, interfaces réseaux et carte SD ne sont pas connectés sur le processeur 32U4, mais le processeur AR9331 et la librairie Bridge permettent à Arduino d'accéder à ces périphériques.

Détails techniques

Arduino

  • Microcontrolleur: ATmega32u4
  • Tension de fonctionnement: 5V
  • Tension d'entrée (recommandée): 5V via microUSB ou PoE 802.3af
  • Tension d'entrée (limites): 6-20V
  • Entrée/sortie digital: 14
  • PWM: 7 canaux
  • Entrées analogiques: 6 (plus 6 multiplexées sur 6 broches digitals)
  • Courant continu par entrée/sortie: 40 mA
  • Courant continu pour broche 3.3V: 50 mA
  • Mémoire Flash: 32 KB (ATmega32u4) dont 4 KB utilisé par le bootloader
  • SRAM: 2.5 KB (ATmega32u4)
  • EEPROM: 1 KB (ATmega32u4)
  • Vitesse d'horloge: 16 MHz

Machine Linux embarquée

  • Processeur MIPS 24K fonctionnant jusqu'à 400 MHz
  • RAM: 64MB DDR2 (et Flash de 16MB SPI)
  • IEEE 802.11bgn complet 1x1 AP ou routeur
  • WIFI
  • Connexion Ethernet
  • USB: USB 2.0 host/device
  • Compatibe Power Over Ethernet (poE) 802.3af
  • Support carte MicroSD

Schéma & références de conception

Schéma: arduino-Yun-schematic.pdf

Alimentation

Il est recommandé d'alimenter la carte par l'intermédiaire de la connexion micro-USB avec 5VDC.

Si vous alimentez la carte par l'intermédiaire de la broche Vin, vous devez fournir une tension régulée à 5VDC. Il n'y a pas de régulateur de tension sur la carte pour gérer les tensions supérieures. La carte sera donc endommagée en cas de surtension!

Le Yún est également compatible les les modules PoE (Power Over Ethernet) mais vous aurez besoin d'ajouter un module PoE pour bénéficier de cette fonctionnalité.

Les broches d'alimentation sont les suivantes:

  • VIN: Tension d'entrée de la carte Arduino. A l'opposé des autres cartes Arduino, si vous voulez alimenter votre carte par cette broche il faut absolument fournir une tension régulée à 5 volts.
  • 5V: La tension d'alimentation utilisée pour alimenter le microcontrôleur et les autres composants de la carte. Peut provenir soit de VIN ou du port USB (d'alimentation).
  • 3V3: Une alimentation 3.3 volts générée par le régulateur disponible sur la carte. Courant maximum 50 mA.
  • GND: Broches de masse/GND/Ground.
  • IOREF: La tension à laquelle les broches d'entrée/sortie de la carte fonctionnent (ex. VCC pour la carte). C'est 5V sur un Yún.

Mémoire

L'ATmega32u4 dispose de 32 KB (avec 4 KB utilisé par le bootloader). Il dispose également de 2.5 KB de SRAM et de 1 KB d'EEPROM (qui peut-être modifiée à l'aide de de la librairie EEPROM).

La mémoire du AR9331 n'est pas incluse dans le processeur. La RAM et mémoire de stockage sont disposées à l'extérieur du processeur. Le Yún dispose de 64 MB de RAM DDR2 et de 16 MB de mémoire Flash. La mémoire flash est préchargé en usine avec une distribution Linux basée sur OpenWRT. Cette distribution s'appelle Linino.

Vous pouvez modifier le contenu de cet image d'usine, en installant un programme ou en modifiant le fichier de configuration. Vous pouvez revenir à la configuration d'usine en pressant le bouton "WLAN RST" pendant 30 secondes.

Entrée et Sorties

It is not possible to access the I/O pins of the Atheros AR9331. All I/O lines are tied to the 32U4.

Each of the 20 digital i/o pins on the Yún can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have specialized functions:

  • Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Yún, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class. The hardware serials of the ATmega32U4 and the AR9331 on the Yún are connected together and are used to communicate between the two processors. As is common in Linux systems, on the serial port of the AR9331 is exposed the console for access to the system, this means that you can access to the programs and tools offered by Linux from your sketch.
  • TWI: 2 (SDA) and 3 (SCL). Support TWI communication using the Wire library.
  • External Interrupts: 3 (interrupt 0), 2 (interrupt 1), 0 (interrupt 2), 1 (interrupt 3) and 7 (interrupt 4). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details. Is not recommended to use pins 0 and 1 as interrupts because they are the also the hardware serial port used to talk with the Linux processor. Pin 7 is connected to the AR9331 processor and it may be used as handshake signal in future. Is recommended to be careful of possible conflicts if you intend to use it as interrupt.
  • PWM: 3, 5, 6, 9, 10, 11, and 13. Provide 8-bit PWM output with the analogWrite() function.
  • SPI: on the ICSP header. These pins support SPI communication using the library. Note that the SPI pins are not connected to any of the digital I/O pins as they are on the Uno, They are only available on the ICSP connector. This means that if you have a shield that uses SPI, but does NOT have a 6-pin ICSP connector that connects to the Yún's 6-pin ICSP header, the shield will not work.

The SPI pins are also connected to the AR9331 gpio pins, where it has been implemented in software the SPI interface. This means that the ATMega32u4 and the AR9331 can also communicate using the SPI protocol.

  • LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
  • There are several other status LEDs on the Yún, indicating power, WLAN connection, WAN connection and USB.


Arduino-Yun-Pres10.jpg
Crédit: Arduino arduino.cc Traduction: MCHobby.be

  • Analog Inputs: A0 - A5, A6 - A11 (on digital pins 4, 6, 8, 9, 10, and 12). The Yún has 12 analog inputs, labeled A0 through A11, all of which can also be used as digital i/o. Pins A0-A5 appear in the same locations as on the Uno; inputs A6-A11 are on digital i/o pins 4, 6, 8, 9, 10, and 12 respectively. Each analog input provide 10 bits of resolution (i.e. 1024 different values). By default the analog inputs measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.
  • AREF. Reference voltage for the analog inputs. Used with analogReference().

There are 3 reset buttons with different functions on the board:

Arduino-Yun-Pres11.jpg
Crédit: Arduino arduino.cc Traduction: MCHobby.be

  • Yún RST: Bring this line LOW to reset the AR9331 microprocessor. Resetting the AR9331 will cause the reboot of the linux system. All the data stored in RAM will be lost and all the programs that are running will be terminated.
  • 32U4 RST: Bring this line LOW to reset the ATmega32U4 microcontroller. Typically used to add a reset button to shields which block the one on the board.
  • WLAN RST: This button has a double feature. Primarly serves to restore the WiFi to the factory configuration. The factory configuration consist to put the WiFi of the Yún in access point mode (AP) and assign to it the default IP address that is 192.168.240.1, in this condition you can connect with your computer to the a WiFi network that appear with the SSID name "Arduino Yun-XXXXXXXXXXXX", where the twelve 'X' are the MAC address of your Yún. Once connected you can reach the web panel of the Yún with a browser at the 192.168.240.1 or "http://arduino.local" address. Note that restoring the WiFi configuration will cause the reboot of the linux environment. To restore your WiFi configuration you have to press and hold the WLAN RST button for 5 seconds. When you press the button the WLAN blue LED will start to blink and will keep still blinking when you release the button after 5 seconds indicating that the WiFi restore procedure has been recorded. The second function of the WLAN RST button is to restore the linux image to the default factory image. To restore the linux environment you must press the button for 30 seconds. Note that restoring the factory image make you lose all the files saved and softwares installed on the on-board flash memory connected to the AR9331.

See also the mapping between Arduino pins and ATmega32u4 ports.

Communication

The Yún has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega32U4 provides a dedicated UART TTL (5V) serial communication. The 32U4 also allows for serial (CDC) communication over USB and appears as a virtual com port to software on the computer. The chip also acts as a full speed USB 2.0 device, using standard USB COM drivers. The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB connection to the computer.

Digital pins 0 and 1 are used for serial communication between the 32U4 and the AR9331. Communication between the processors is handled by the Bridge library.

A SoftwareSerial library allows for serial communication on any of the Yún's digital pins except for pins 0 and 1.

The ATmega32U4 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI communication, use the SPI library.

The Yún appears as a generic keyboard and mouse, and can be programmed to control these input devices using the Keyboard and Mouse classes.

The onboard Ethernet and WiFi interfaces are exposed directly to the AR9331 processor. To send and receive data through them, use the Bridge library. To configure the interfaces, you can access the network control panel as described in the getting started page.

The Yún also has USB host capabilities through Linino. You can connect peripherals like USB flash devices for additional storage, keyboards, or webcams. You may need to download and install additional software for these devices to work. For information on adding software to the AR9331, refer to the notes on using the package manager.

Programmation

The Yún can be programmed with the Arduino software (download). Select "Arduino Yún from the Tools > Board menu (according to the microcontroller on your board). For details, see the reference (Anglais, Arduino.cc) and tutorials] (Anglais, Arduino.cc).

The ATmega32U4 on the Arduino Yún comes preburned with a bootloader (Anglais, Arduino.cc) that allows you to upload new code to it without the use of an external hardware programmer. It communicates using the AVR109 protocol.

You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial Programming) header; see these instructions (Anglais, Arduino.cc) for details.

Reset Automatique

Cette section concernent le Reset Automatique (Logiciel) et le démarrage du Bootloader.

Rather than requiring a physical press of the reset button before an upload, the Yún is designed in a way that allows it to be reset by software running on a connected computer. The reset is triggered when the Yún's virtual (CDC) serial / COM port is opened at 1200 baud and then closed. When this happens, the processor will reset, breaking the USB connection to the computer (meaning that the virtual serial / COM port will disappear). After the processor resets, the bootloader starts, remaining active for about 8 seconds. The bootloader can also be initiated by pressing the reset button on the Yún. Note that when the board first powers up, it will jump straight to the user sketch, if present, rather than initiating the bootloader.

Because of the way the Yún handles reset it's best to let the Arduino software try to initiate the reset before uploading, especially if you are in the habit of pressing the reset button before uploading on other boards. If the software can't reset the board you can always start the bootloader by pressing the reset button on the board.

Protection sur-courant sur USB

The Yún has a resettable polyfuse that protects your computer's USB ports from shorts and overcurrent. Although most computers provide their own internal protection, the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse will automatically break the connection until the short or overload is removed.

Encombrement

Physical Characteristics

The maximum length and width of the Yún PCB are 2.7 and 2.1 inches respectively, with the USB connector extending beyond the former dimension. Four screw holes allow the board to be attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.


Source: Arduino Yun, Guide to the Arduino Yún. Crédit: Arduino.cc, licence Creative Common Attribution ShareAlike.

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.