ARDUINO DEVELOPMENT

Our GATOR Plus+ development board is compatible with the development tools in the Arduino community,  meaning you can take advantage of the many freely-available libraries and example programs available there. You can use these as a starting point for developing your own custom applications, or just for learning about microcontrollers.

This page describes how to download the free Arduino development system and configure it to work with your GATOR Plus+ development board.

Please note that our products are not affiliated with or endorsed by the Arduino team.

Quick Links:

Step 1: Download Arduino Software

There are three different ways to get started with the Arduino development system -- pick the one that’s best for you:

  1. Option 1: Download our ready-to-run version of the Arduino software
    • This is the easiest way to get started, especially if you have never tried the Arduino development system.

  2. Option 2: Apply our changes to an existing Arduino software installation to enable GATOR Plus+ compatibility
    1. If you already have an Arduino software installation, then just applying our changes will minimize downloading time.

  3. Option 3: Download the Arduino source code, apply our changes, then build the software from scratch
    • This option is for the true do-it-yourselfer

Option 1: Ready-to-Run Software

The easiest way to get started with the Arduino development system on your GATOR Plus+ is to download the Arduino software with all necessary changes already applied. This software includes the standard Arduino software, so you can  use any Arduino-compatible board, not just the GATOR Plus+.

Download (Version 0018 based on SVN revision 942):

Installation (Windows):

The ZIP file for Windows is a self-contained archive that contains the Arduino development system. There is no formal installer program. Just extract the archive to the directory of your choice (e.g., C:\Program Files\Arduino is suggested).

After extracting the ZIP file, you will find the main executable file ‘arduino.exe’ in the top-level directory. Place a link to this executable file on your Desktop for easy access.

Installation (Linux):

For Linux, the TGZ file must be extracted using the TAR program to the directory of your choice (e.g., /opt/Arduino is suggested). The executable file ‘arduino’ is in the top-level directory.

The Linux distribution requires a separate Java JRE (Java Runtime Environment) or JDK (Java Development Kit) installation. Most Linux systems already have a JRE or JDK installed. If not, start your package manager to search your distribution’s package repositories for the latest JRE or JDK, or download it directly from http://java.sun.com.

The Linux distribution also requires a separate installation of the AVR development tools (AVR-GCC, AVR-LIBC, and AVRDUDE). Please see our Linux page for more information.

Installation (Mac OS X):

Open the DMG file and drag the Arduino.app directory to the Applications folder.

Option 2: Base Software Plus Changes

It is assumed that you have already downloaded the base Arduino software directly from the Arduino download page. If you have not already installed it, then follow the same installation instructions as for “Ready-to-Run Software” above.

The second step is to download the update file from the links below and place it in the top-level Arduino directory. That is, it should be in the same directory as the Arduino executable file. For Mac OS X 10.6, place the update file in the /Applications/Arduino.app directory.

Download:

Installation:

Extract the file you downloaded, making sure to preserve the directory structure.

Configuration:

If you have already used the existing Arduino installation, then a system-wide configuration file has been created for you. This configuration file has to be edited to add a new option to support the GATOR Plus+.

  1. Start the Arduino program then select File->Preferences.
  2. At the bottom of the Preferences dialog you will see a pathname that points to a file named ‘preferences.txt’. Make a note of the full pathname for this file.
  3. To edit this file, you must first CLOSE the Arduino program, otherwise any changes you make to the preferences file will be lost, as the Arduino program overwrites this file when it exits.
  4. After you have closed the Arduino program, open the preferences file in a text editor and add the following line at the bottom:
  5. upload.reset_dialog=true

The ‘preferences.txt’ file will not exist if the Arduino program has never been run. In this case, it will be created automatically the first time the program runs and the ‘upload.reset_dialog’ option will be set to ‘true’ by default.

Option 3: Compile From Source

This is the most time-consuming option but it allows you to (if you are interested) exactly recreate the ready-to-run software we make available above. First, check out the latest Arduino code from its GIT repository:

    git clone git://github.com/arduino/Arduino.git

Then, download the patch file below.

Download:

Place the patch file in the ‘Arduino’ directory and apply the patches:

    patch -p1 < arduino-0022-patch.txt

Build the Arduino software as usual, by entering the build directory for the OS of your choice (e.g., ‘build/windows’) and running the ‘ant’ program.

Step 2: Configuration

Run the Arduino executable program, then select the Tools menu, then the Board sub-menu, and finally select the “Rugged Circuits Gator Board” option, as shown below.

Plug in your board, wait a few seconds for it to be recognized, then select the Tools menu, then the Serial Port sub-menu. You should see your board listed as a virtual serial port (most likely not COM1 or COM2 as these are built-in serial ports). In the example screenshot below, the GATOR Plus+ board has been assigned the virtual serial port COM122.

The virtual serial port name will likely be called something like /dev/ttyUSB0 for Linux and Mac OS X systems. See our Linux page for more information on ensuring connectivity for these systems.

Step 3: Running Sketches

In the Arduino community, a program that runs on the hardware system is called a “sketch”. There are several example sketches available to use as templates for your own code.

To demonstrate how to run and download sketches to your GATOR Plus+ board, try the following steps.

  1. Open up the “Blink” example sketch by selecting File->Sketchbook->Examples->Digital->Blink. Select File->Save As to save a copy of your sketch in your own folder (e.g., My Documents/Arduino/Blink).
  2. Once your sketch is saved, press Ctrl-R or select the Sketch->Verify/Compile menu item. In a few seconds you should see the status message “Done Compiling” appear at the bottom of the window.
  3. Press Ctrl-U or select the File->Upload to I/O Board menu item. When prompted by a dialog, press the reset button on your GATOR Plus+ board and dismiss the dialog, then in a few seconds your sketch will be installed.
  4. The “Blink” sketch will cause the GATOR Plus+ on-board LED to blink repeatedly.

Note that the dialog that prompts you to press the reset button is enabled by the entry “upload.reset_dialog=true” in the Arduino preferences file. If this entry is missing or is set to ‘false’, uploading will proceed immediately after compilation which will make it difficult to press the reset button with the right timing. If for some reason you are not seeing this dialog, you will have to manually add the above entry as described above in Option 2.

Step 4: Exploration

There are many paths you can follow from this point:

  • Modify the delay timings in the Blink application to become more familiar with the editor and the compilation/downloading process
  • Look at some of the other example sketches. For example, try the File->Sketchbook->Examples->Analog->AnalogInput sketch.  Hook up a potentiometer as in the following schematic, then watch the on-board LED blink at a rate that depends upon the potentiometer position.
  • Browse through the entries in the Help menu, especially the Getting Started and Reference items.
  • Install the Bitlash application (see the section below) and explore the Arduino functions interactively.

Bitlash

Bitlash is an interactive interpreter that supports many Arduino functions, allowing you to quickly experiment and prototype your ideas. There is no compiler and no downloading; things happen as soon as you type in commands.

Bitlash is a third-party open source application. It is described and documented at the Bitlash web site.

An implementation of Bitlash is available for the GATOR Plus+:

Download (Version 0.95a-RC)

For a simple example of how to use Bitlash:

  • Download the bitlash.hex file
  • Using the Devices tab of our software, install the bitlash.hex file into your GATOR Plus+ board.
  • Switch to the Terminal tab
  • Type ‘help’ for summary help information
  • Type in the following program -- this will make the on-board LED blink repeatedly until you press Ctrl-C
  • pinMode(13, 1)
    while 1: d13=0; delay(500); d13=1; delay(500)

Please see the Bitlash web site for a full reference and description of Bitlash capabilities.

Additional Information

Pin Numbers

The Arduino system uses pin numbers to access all of the microcontroller’s I/O pins. The mapping between these Arduino pin numbers and the actual port names and port pins on the ATmega324P microcontroller is shown in the table below.

Arduino

Digital Pin

Arduino

Analog Pin

AVR Port Pin

Special Function

0

 

PORTC:0

 

1

 

PORTC:1

 

2

 

PORTC:2

 

3

 

PORTD:6

PWM (TIMER2B)

4

 

PORTC:3

 

5

 

PORTB:4

PWM (TIMER0B)

6

 

PORTB:3

PWM (TIMER0A)

7

 

PORTD:2

 

8

 

PORTD:3

 

9

 

PORTD:5

PWM (TIMER1A)

10

 

PORTD:4

PWM (TIMER1B)

11

 

PORTD:7

PWM (TIMER2A)

12

 

PORTC:4

 

13

 

PORTC:6

On-board LED

14

0

PORTA:0

 

15

1

PORTA:1

 

16

2

PORTA:2

 

17

3

PORTA:3

 

18

4

PORTA:4

 

19

5

PORTA:5

 

20

6

PORTA:6

 

21

7

PORTA:7

 

22

 

PORTC:5

 

23

 

PORTB:0

 

24

 

PORTB:1

 

25

 

PORTB:2

 

26

 

PORTB:5

 

27

 

PORTB:6

 

28

 

PORTB:7

 

Sketches and HEX Files

Note that the Arduino software compiles your sketches into the form of a HEX file, the same file format expected by the Rugged Circuits GUI software for custom applications. For each sketch that has been compiled and uploaded (with Ctrl-U), an “applet” subdirectory will exist in the sketch directory (e.g., My Documents/Arduino/Blink/applet). This “applet” subdirectory will contain the HEX file for the sketch (e.g., “Blink.hex”).

To upload this HEX file in the Rugged Circuits GUI software, click on the Devices tab, select your GATOR Plus+ board from the Connected Devices list, then press the Browse button at the bottom right to navigate to your HEX file. Then, press the Install button at the bottom of the window.

Bootloader Installation

GATOR Plus+ boards must have a bootloader installed that supports the Arduino development system. Older GATOR Plus+ boards do not have this bootloader, but one can easily be installed.

If you cannot download sketches to your GATOR Plus+ board, try installing the most recent bootloader as follows:

  • Download the latest Rugged Circuits GUI Software (version 1.4 or greater)
  • Plug in your GATOR Plus+ board and select it in the Devices tab
  • Click on the Setup tab
  • Click on the Configure Fuses button, then the Verify Fuses button
  • Click on the Install Bootloader button (sorry! this takes a few minutes)
  • Click on the Verify Bootloader button. You should see a message that indicates “Bootloader Revision 2” is installed.

Copyright © 2013 Rugged Circuits LLC