Outils pour utilisateurs

Outils du site


wiki:tutoriels:intel_galileo_arduino

Ceci est une ancienne révision du document !


Introduction - Most users of the RPi, Beagle Bone, or any other Arduino platform are probably familiar with the ARM microcontrollers used on these respective platforms. The Intel Galileo is unique in that is uses a x86 family microprocessor. ARM and x86 differ at a fundament level: the size of their instruction set. ARM is a RISC (Reduced Instruction Set Computing, a smaller, simpler instruction set) architecture and x86 processors are CISC (Complex Instruction Set Computing, a more complex, and powerful set). Something that takes an x86 one clock cycle, might take an ARM processor three.

However, because the Quark X1000 was develloped in partnership with Arduino, it is entirely possible to download the Arduino IDE directly onto the Galileo. This will allow, in essence, to have a fully operational arduino uno R3 directly integrated onto the board. It will even be compatible with all R3 libraries and all arduino 3.3V/5V shields!

Download & Install

For Windows The Arduino IDE (1.6.0 /V1.8) can be downloaded here. Note that this tutorial was written on 16/12/2016 and all newer versions of the software can be found via a search for “Galileo Gen 2” on the intel download center webpage

The .ZIP file should be unpacked directly onto the “C:/” with a name that includes NO SPACES! You can then open the Arduino.exe to run

For Linux

The Arduino IDE (1.6.0 /V1.8) can be downloaded here. Note that this tutorial was written on 16/12/2016 and all newer versions of the software can be found via a search for “Galileo Gen 2” on the intel download center webpage

Linux users need to use the tar tool to extract the tar.gz file. A command like tar -zxvf arduino-1.5.3-linux32.tar.gz should do.

It’s also necessary to disable the modem manager on most Linux distributions, to enable uploading to the board. This will vary by distro, but something like sudo apt-get remove modemmanager will work.

Once installed, run the arduino file in the extracted directory. From a terminal, you can enter ./arduino to run it.

Update Driver

To start, plug in the “barrel jack” power supply to the Galileo Gen 2 card. Then using a Micro USB B cable, plug the micro usb into the “USB Client input” on the Galileo. Plug the other standard USB into your PC.

NOTE Do not plug the USB cable into your PC until you have first plugged the power supply into the card (and the wall obviously)

For Windows

  • Goto the window's start menu and run the software “executer”, within executer run “devmgmt.msc”
  • Select “Ports” and select “Gadget Serial v2.4” within. If nothing else is plugged into you USB ports, then it should be the only object.
  • Right click, and “Update drivers”
  • Auto-search for new Drivers
  • After a few loading bars, if there is any new driver available it will update
  • If not, then it will let you know that your current driver is the most current
  • After updating the driver, right click the “Gadget Serial v2.4”
    • Open proprietes
    • Select the COM parameters tab
    • Select “Advanced” options
    • Change Port number. Make sure the number is under 10
    • Note This is only a precautionary measure as there are reported bugs when the COM# is superior than 10.

For Linux

  • Open terminal
  • type “ ls/dev/ttyACM*
  • Note the COM#

The Arduino IDE for the Galileo is now installed onto your PC. We are also now sure of the COM# of your device and that the driver is fully updated. This will the most basic means of programming Intel's Quark X1000, and will allow us to exploit Arduino's vast opensource online community.

Arduino example

Board Setup

  • Upon running the Arduino IDE select the “Tools” tab
    • Select “COM” and then select the COM# that corresponds with the Galileo (determinde previously in the tutorial)
    • Select “Board” and then select “Intel Galileo Gen 2”

The board will no be properly in sync with the Arduino IDE and we can start to program in the Arduino IDE. I would advise any user that is not already familiar with Arduino to visit their tutorials page. They have a great online community that will get a new user started in a few short hours.

However, know that there exist a number website that already have a lot of basic “programe skeletons” already built.

Also, there are a number of websites that have well documented projects that will have snippets of code already attached

Lastly, remember that the Arduino IDE has an EXTENSIVE list of prewritten scripts that will help the new user (and the experienced alike) to directly start using their Arduino! In the above photo I have highlighted the “Ethernet Sub-menu” as that will be the ultimate goal of this tutorial. However, we will start with the “Hello World” of the Microcontroller world. Let's start with…

The Blink LED 13 test

With the Arduino IDE open and configured to the proper COM#/Board:

  • Goto “File” in the upper right corner of Arduino
    • Scroll to Examples/Basics
    • Select “Blink”

  • The “Blink” Code will be created in a second Arduino Window
    • Let's take a closer look at this code
    • Note: As we look at the lines of code we can identify the line we are by the small white number in the bottom right of the Arduino IDE
    • Line 18 we have “void setup() {”
      • In the future everything that falls between the ”{“ and the ”}“ on line 21, will be used (at the most basic level) to define the activity of the pins on the Galileo. For example:
      • Line 20 ” pinMode(13,OUTPUT);
        • Within the void setup, this means that all signals at pin13 on the galileo will be outgoing. This could be a signal to open a transistor, a signal to a DC motor, a feed back from a sensor, or be used to blink a led
      • Line 21 “}”
        • End of the setup. All setup instructions MUST be found before this
      • Line 24 void loop() {
      • Anything found after this command (in the most basic uses) will be the main function of your code. Here is where we will tell the Galileo what to do with our various pins found on the card. Remember we have already defined which pins will be used and how. So now we..
        • Line 25 digitalWrite(13,HIGH);
          • We will “write” message to the pin 13 to tell it to be “HIGH”. This essentially means that pin 13 (which was defined to be an output on line 20) will be “High” or “On”.
        • Line 26 delay(1000);
          • We delay 1000 miliseconds or 1 second
        • Line 27 digitalWrite(1000);
          • Now we write a new message to pin 13 telling it to be “LOW” or “Off”
          • Line 28 delay(1000);
            • same as line 26
          • Line 29 “}”
            • This marks the end of the Block “void loop()”. All primary functions of the Galileo code must be found between this and the begining of the loop “{”.

  • We now select the “Download” button as we know the code is properly formated
  • The downloading process may take a few seconds. Note for the experienced Arduino User, it is noticably slower than the Arduino Uno. It has been noted that elsewhere that this is a common concern with the use of the Quark X1000 microprocessor.
wiki/tutoriels/intel_galileo_arduino.1482013103.txt.gz · Dernière modification: 2016/12/17 22:18 de royce