the blog

The Intel Galileo Board and Bee Mail Part 2: Blink

by Carlyn Maw on February 16, 2014, 6 comments

External LED hooked up to Galileo Board

The Intel Galileo Board hooked up to an external LED on Pin 8

This section of the write up covers:

  • Intel Galileo Board out of the box to first sketch
  • Retaining a sketch through reboot
  • Wiring up an external LED

I will be assuming familiarity with making Arduino projects. The goal is to point out potential gotcha’s for Arduino/MacOS users and to have record for myself in the future.

The Galileo board is susceptible to static so no shuffling across carpets. Do keep the board in its anti-static bag if when not in use.

Hello World: Blinking the onboard LED

Galileo blinking the LED on Pin 13

Galileo blinking the LED on Pin 13

If you are on a Mac read the getting started tutorial by Stefano Guglielmetti on the Arduino blog.  It is simple and covers all the potential pitfalls for those used to working with an Arduino in a particular way. The SparkFun getting started is more thorough. I wish I had read them both before I jumped in. The knowledge they contain would have saved me heaps of time. Here are some steps of my own.

  • Download the software from Intel’s Galileo site. It is also called “Arduino.” Do rename it and move it to the Applications folder, but keep the name of the development application short (less than 8 character) without spaces (i.e. “ArduiG” not “Arduino Galileo”) Open the application to make sure it works and then close it. Despite the rename the menu bar will still display the word Arduino when the application is open.
    • When I download the software from Intel, to prevent conflicts with existing Arduino software, I changed the name of the development environment to “Arduino Galileo.” It opened just fine. However, when updating the firmware the processes failed with the message “<< Target Firmware Version Query Failed >>” Searching the for that message on the Galileo forum got me the answer about the file name. There are more tips on how to name files from Apple.
    • The sparkfun tutorial has directions for Windows and Linux as well.  If you are not on a Mac you will also need to install drivers.
  • Plug in the Galileo into the provided external supply for 10 seconds or so. Everyone Says This in Bold Letters.
    • The couple of times I’ve forgotten for a second it hasn’t destroyed my board, but it’s a risk. Why is this a big deal? The Galileo needs more than the 500 mA provided by the USB 2.0 spec to run and depending on your USB port it could lose power mid boot-up sequence, ruining the board? That is just a guess. There may be a different hardware reason as well. I have not examined the schematic.
    • The external power supply must be a regulated switching 5V supply. The Galileo works natively at 3V so it’s power circuits really can’t handle that 12V wall wart Arduino motor or LED strip tutorials call for. Further reading on power supplies: Adafruit, SparkFun and Apogee Kits
  • Plug in the USB cable (the one next to the ethernet port), count to 10. Then open your Intel Galileo Arduino IDE, whatever you called it.
  • Look for the board to appear in the “Tools > Serial Port” On a Mac, the correct port to use for the Galileo is on the /dev/cuXXX port not the /dev/ttyXXX port. I’ve forgotten that at least twice now and been confused by a “board not available error” when my board was clearly plugged in and turned on.  The USB driver chip on Galileo is different than the one on the my ol’ Duemilanove and it just wants different things.
    • The tty vs cu conversation is deep in the history of how these technologies developed and I’ve found no answers that weren’t jargon laden. The gist is that conventionally cu is for the master server to establish connections on and tty is for dependant devices to establish connections on.
    • If you don’t see the board listed, the support site recommends: “Close the Arduino software first, then unplug the USB cable from your computer. Try repeating the process until the port is recognized. Restarting your computer will help you in debugging the issue.”
  • Update the firmware via “Help > Firmware.” Once I got the name problem figured out, this worked smoothly for me except, although I had to reboot the software when finished.
  • Load the blink sketch from Examples > 01.Basics > Blink (No problems)
  • Watch the LED on pin 13 blink (No problems)
  • Change the delay time in the blink sketch, watch again (No problems)

Yay! Blinking LED! At this point the USB cable can be detached from the computer and the Galileo will blink just with it’s power supply connected. But only while the board stays plugged in. As soon as the Galileo powers down it will forget ever having a sketch uploaded.   Booting from an SD Card fixes that problem.

Set up the SD Card

The Galileo board is quite clever. The entire operating system lives all folded up origami style on a tiny little chip and every time the power comes on the code unfurls into more memory, retreating as power fades from the board. Poetic, really. However, that elegance leaves no crannies for an Arduino sketch to hide in. The SD card provides a big container with more leg room for sketches and amenities like Python and WiFi. So with the Galileo get a card that is 1GB to 32 GB and a way to read it.   Once again I will point to the SparkFun tutorial, but the steps run pretty smoothly.

  1. Download the LINUX IMAGE FOR SD for Intel Galileo from the drivers page
  2. Decompress the archive
  3. Put the files on the SD card at the root level
  4. put the SD card in the unpowered Galileo
  5. Plug in Power, Wait for the USB light to come on, The SD card light to start and then stop flickering,
  6. Plug in the USB cable
  7. Reopen the software
  8. Pick the device from “Tools > Serial Port” (the name will have changed, still the /dev/cuXXX port)
  9. Load blink sketch
  10. Quit the software
  11. Unplug USB
  12. Unplug Power
  13. Plug in power, wait again ~20 to 40 seconds, watch blink

For me the biggest hurdle was the 7-zip format of the compressed file.  On a Mac, software like The Unarchiver will work. (Thanks SparkFun!). The day I prepared an SD card for the first time it took me ages to find software that was free for an archive of this size (Springy hit a pay wall) and easily configured for the mac. Whatever search terms I was using weren’t working for me that day. I have access to a Windows machine so I just used that.

Blink an external LED

The next step of course is to blink an external LED. Normally for Arduino 101 I would hook up an LED with the anode towards the microcontroller so setting digitalWrite(myPin, HIGH) would turn on the LED.  The consequences of frying a pin on a Galileo are higher than on an Uno and the Galileo Spec indicates that the board is designed provide a maximum of 10 mA or receive a maximum of 25 mA. As a result, I would suggest using negative logic instead.  Negative logic means that the LED is wired cathode (ground side) to the microcontroller so the microcontroller can sink the power rather than source it.

LED Logic & Wiring Diagram

LED Logic & Wiring Diagram

In the picture below an LED is hooked up to the 5V output of the Galileo board and pin 8. The code is the same example sketch with the variable “led” set to 8. The LED still blinks, just with the timing inverted.  As shipped the Galileo board has a jumper that bumps the power of the I/O pins up to 5V. The Galileo’s microcontroller supplies 3V natively, but the folks at Intel thoughtfully added multiplexers to their board so it would run like the basic Arduino hardware. For now, leave the jumper the way it came and set up the LED with a 220 Ohm or 330 Ohm resistor and watch it blink.

Intel Galileo blinking an external LED

Intel Galileo blinking an external LED

  • Part 1
    • Overview
  • Part 2 – This Post
    • From Zero to Blink.
    • Creating an SD card image and getting a sketch to persist on the Galileo
    • Blink on an external LED
  • Part 3
    • Creating the bees and getting them to work on an Arduino UNO
  • Part 4
    • Setting up Wifi (very easy, library examples worked immediately)
    • Getting the SD card read & write to work (a missing libraries/symlink problem)
  • Part 5
    • Serial Communication to the Linux Core
    • Troubleshooting Python on the Galileo
  • Part 6
    • Revising the example String to Int code (lack of Null Termination problems)
    • Moving the motors over to the Galileo

6 thoughts on “The Intel Galileo Board and Bee Mail Part 2: Blink

  1. Pingback: carlynorama | Intel Galileo and Bee Mail Part 5: Troubleshooting Python in the Linux Shell

  2. Pingback: carlynorama | Intel Galileo and Bee Mail Part 4: Working with Libraries

  3. How can I have a sketch run on power up? You mention I compressing a larger version on Linux onto an sd card but can I drop a sketch in there as well and it runs in power up?

  4. Pingback: carlynorama | Intel Galileo and Bee Mail Part 3: The Object

  5. Pingback: carlynorama | The Intel Galileo Board and Bee Mail Part 1: Overview

Leave a Reply

carlynorama is Stephen Fry proof thanks to caching by WP Super Cache