wiki:tutoriels:intel_galileo_arduino
*
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!
NOTE: We will assume that you have created a folder “ C:/Galileo ” for the sake of this tutorial
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:/Galileo/” with a name that includes NO SPACES! We will use
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.
You must visit Intel's download center to download the appropriate Firmware Updater.
*Unzip this file into: C:/Galileo/
*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”
* Select “Search PC for updates”
* Search within the folder C:/Galileo/Galileo Driver
* After a few loading bars, you will be asked to verify the update. Select yes.
* The “Gadget Serial v2.4 should now be named “Galielo”
* After updating the driver, right click the “Galileo”
* 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*
* Restart the udev: sudo service udev restart
* Note the COM#
Update Firmware
Now that the COM# is known and the latest driver has been installed we must update the firmware witin the Galielo Gen2.
*Open “firmware-updater-x.x.x” found withing C:/galileo, it may take a moment to fully load.
*Make sure at this point that your PC battery is not near empty
*Chose the proper COM# for your device under “Port”
*Update Firmware
* You will be prompted to confirm an external power for the Galileo
* OK
*You will be asked to confirm the update
*Yes
*DO NOT UNPLUG YOUR GALILEO OR TOUCH ANY BUTTONS
*DO NOT SHUT OF YOUR PC
*The update takes about 3-5 minutes
*When finished you will be prompted concerni
Section Conclusion
The Intel Galileo Gen 2 has now been properly installed onto your PC/MAC and the drivers are installed. Also, we are now sure of the current firmware installed onto the galileo which should allow us to more efficently select development tools that exist.
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.
*Arduino
*GitHub
Also, there are a number of websites that have well documented projects that will have snippets of code already attached
*Instructables
*Hackaday
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.
* The “Blink” script has now been loaded onto your Galileo
That's it. You will notice that on your Galileo board there is now a green LED blinking next to the “USB host” port. This led is hardwired directly to the pin 13. We could easily place a small led (with a 100ohm resistance in series) with another pin#. We would simply need to change the lines:
*20
*25
*27
Conclusion -
This is the most basic means of using the Intel Galileo. We have now been introduced to the Arduino side of the board. However, to use only this would be a poor use of this board as the Uno is capable of this type of project and is quicker. The next sections of this tutorial will now explain how we can install Linux onto the Galileo Gen 2.
The interest of installing Linux is that we will have the means to use:
*WiFi drivers
– The Galileo supports all Intel-chipset WiFi cards with these drivers. Plug them in, and they should be recognized immediately.
*Python
– Python is our favorite when it comes to scripting languages. With Python you can easily post to Twitter, check for unread emails, and perform all sorts of other nifty tricks.
*Node.js
– Node.js is a popular JavaScript-based scripting language. A good alternative to Python, if you’re more comfortable with JS.
*SSH
– Secure Shell (SSH) is an incredibly useful network tool that allows you to log into and control a device remotely. With SSH running on your network-connected Galileo, you can skip both of the terminal methods described on the last page, and remotely control the board from any device on the network.
*openCV
– OpenCV is an open-source computer vision application. You can plug a USB webcam into the Galileo’s USB host port, and use OpenCV to track and recognize objects.
*ALSA
– Advanced Linux Sound Architectures (ALSA) can equip your Galileo (and an attached sound card) with the ability to play and record MIDI files.
*V4L2** – Video4Linux2 is a video record and play utility for Linux. You’ll need a USB webcam attached to your Galileo to make use of this.
Go Home
Introduction to Terminal Serial Com
wiki/tutoriels/intel_galileo_arduino.txt · Dernière modification: 2020/10/05 16:39 (modification externe)