Installing Course Software -- Mac OSX

The following software is needed for this course:

In general you can simply follow the installation instructions available at the sites linked above. The following are some more detailed instructions. All of these instructions assume that the computer is connected to the internet with a reasonably high-speed connection. They will work on lower speed, but some of the downloads are quite large so it might take a while.

Installing the software on Mac OSX

Install a Java Runtime Environment (JRE)

(If you already have a recent Java Runtime Environment, you may skip this step. However there is little harm in not skipping it.)

The JRE is needed because Eclipse and the Teaching Machine are both written in Java. Furthermore the course notes require a Java plugin for your web browser.

  1. Download the installer
    1. Go to the Java download page
    2. Download the current JRE appropriate for your system.
  2. Run the installer
  3. You can now delete the installer.

Install GNU g++ (XCode)

In order for eclipse to work we need the GNU g++ compiler. The most effective way to get this is to install Xcode, which is either available on the OS install disks that came with your Mac or can be downloaded from Apple (see link). You may need to register for Apple Developer Connection to get the latest download, but it's free so why not. We don't use XCode directly, but the compiler comes bundled with it.

Note: For recent versions of Xcode you need to take an extra step to get the versions of gcc and g++ that we use: start Xcode and select Xcode -> Preferences; in that dialog select the download tab and choose "Command line tools" and select install.

CrossPack for AVR Development

The CrossPack provides the version of the compiler that produces code for the Pololu 3pi. It is used by the Eclipse AVR Plugin

  1. Download the installer
    1. Go to the CrossPack download page
    2. Download the current CrossPack-AVR dmg.
  2. Open the dmg file (double click)
  3. Run the installer (double click CrossPack-AVR.pkg)
  4. You can now delete the installer.

Install Pololu AVR Library

  1. Download the installer
    1. Go to the download page and download the most recent libpololu-avr- .zip
  2. Double click the downloaded file to unzip. This will create a directory called libpololu-avr
  3. Open a terminal ( and cd to the libpololu-avr directory. (See the FAQ on this if you don't understand this.)
  4. At the pompt execute the command:
    sudo make install
    This will copy the library object (.a) and header (.h) files to appropriate subdirectories of CrossPack-AVR.

Install the Eclipse IDE

Prerequisite: You should have the Java JRE installed before installing Eclipse.

  1. Download the install file.
    1. Go to the Eclipse downloads page and download "Eclipse IDE for C/C++ Developers"
  2. Extract the files
    1. Eclipse is distributed as a tar.gz file (something like eclipse_cpp-juno-SR2-macosx-cocoa-x86_64.tar.gz), extract it to your computer by double-clicking the file.
    2. This will produce a directory called eclipse in the same directory as the downloaded file.
  3. Drag the eclipse directory to Applications.
  4. You can now delete the install tar.gz file.

Install and configure the Eclipse AVR Plugin

  1. Start the eclipse application (in Applications:eclipse), when prompted create a workspace where you will keep all your programming projects for this course.
  2. Add the AVR Download site to the Eclipse available software sites.
    1. Select Help->Install New Software and select the Add button on the upper right.
    2. Add the site
  3. Select AVR Eclipse Plugin from the list and proceed with the install.
  4. Restart eclipse, you should now see the "AVR" button () in the toolbar.
  5. Configure Eclipse to use the programmer (see also Setting up your programmer for Mac OS X).
    1. Connect the USB AVR Programmer (the small circuit card that is in the kit with the 3pi) to your USB port. If you see a popup about "A new network interface" click cancel.
    2. In a terminal type ls /dev/tty.usb* and press enter. You should see one to three entries of the form tty.usbmodem<number> (e.g., /dev/tty.usbmodem00053771). The one with the lowest number is the one you want.
    3. Create a new C++ project selecting "empty project" under AVR Cross Target Application and ensure that the AVR-GCC Toolchain is selected.
    4. Select the project and select Project->Properties. Select AVR Dude and click the new button for programmer configuration.
    5. Name the configuration something helpful, such as "3pi Robot", select Atmel AVR ISP V2 and enter the port identifier (from step 2) in "Override default port (-P)", then click "Ok" in the new configuration dialog, and "Apply" in the Project properties dialog.
    6. Select Target hardware under AVR Dude in the project properties dialog. Connect the 3pi and turn it on, then click Load from MCU, a progress dialog should appear briefly, then disappear. Set the MCU Clock Frequency to 2000000. Select "Ok".
    7. You can reuse this project configuration for other 3pi projects by copy and paste the project.

Install the Teaching Machine

Prerequisite: You must have the Java JRE Installed before you install the TM

  1. Download the installer
    1. Log on as an administrator
    2. Connect to the internet (a high-speed connection is needed).
    3. Download The Teaching Machine by clicking on this link
  2. Extract the zip file to somewhere convenient such as in the Downloads folder (but not C:\).
  3. In the extracted folder, the file TM-Distribution/index.htm contains further instructions and information.
  4. If you want to use the TM eclipse plug-in then follow the instructions given in the file eclipse-plug-in-instructions.txt in the installation directory.
  5. You can now delete the installation zip and the extracted files (but not the installation directory).