Pololu Orangutan User Manual

Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation
Pololu Orangutan USB
Programmer User's Guide
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Contacting Pololu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Module Pinout and Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. USB-to-Serial Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5. Getting Started Using Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.a. Using AVR Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.b. AVR Studio in More Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.c. Conguring Your Programmer for AVR Studio . . . . . . . . . . . . . . . . . . 14
5.d. Using AVRDUDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6. Getting Started Using Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8. Updating Your Programmer’s Firmware . . . . . . . . . . . . . . . . . . . . . . . . 21
8.a. Upgrade Preparations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.b. Uploading the New Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Page 1 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation
The Orangutan USB Programmer [http://www.pololu.com/catalog/product/740] is a compact solution for programming our Orangutan robot controllers[http://www.pololu.com/catalog/
category/8] or 3pi robot [http://www.pololu.com/catalog/product/975] through a USB port. Our
programmer incorporates a USB-to-serial adapter and emulates an AVR ISP programmer so that you can program your Orangutans or 3pi with any software that can talk through a serial port to an AVR ISP. The unit also doubles as a USB-to-serial adapter (TX and RX only), allowing you to communicate with your Orangutan, 3pi, or any other microcontroller, through a terminal program.
Unlike some other AVR programmers, the Orangutan USB programmer does not recieve its power from the circuit to be programmed. Instead, it receives its power via the USB A to mini-B cable [http://www.pololu.com/catalog/product/130] that connects it to a personal computer. This cable is not included with your programmer; if you do not already have one, you can purchase it separately from our web site. The 6-pin ISP programming cable that connects the programmer to your target device is included.
Note: The Orangutan USB programmer should be able to program all AVR microcontrollers that support paged program and EEPROM memory, but we can only support Orangutan and 3pi programming at this time. This product is not needed for the Orangutan X2, which has its own built-in AVR ISP programmer.
For a Spanish version of this document, please see Pololu Orangutan USB
Programmer Guia Usuario [http://www.pololu.com/le/download/
PololuOrangutanUSBProgrammerGuiaUsuario.pdf?le_id=0J136] (1358k pdf) (provided by
customer Jaume B.).
1. Overview Page 2 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation

2. Contacting Pololu

You can check the Orangutan USB Programmer page [http://www.pololu.com/catalog/product/
740] for additional information. We would be delighted to hear from you about any of your
projects and about your experience with the Orangutan USB programmer. You can contact us [http://www.pololu.com/contact] directly or post on our forum [http://forum.pololu.com/]. Tell
us what we did well, what we could improve, what you would like to see in the future, or anything else you would like to say!
2. Contacting Pololu Page 3 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation

3. Module Pinout and Components

Pololu Orangutan USB Programmer labeled top
view
Pololu Orangutan USB Programmer labeled bottom
view
USB-to-Serial Adapter Mode:
The location of the blue mode jumper determines whether the device will function as a programmer or a USB-to-serial adapter. When the mode jumper spans the two pins that are marked on the bottom of the board with a “U”, the computer’s RX line is connected to the pad labeled RX and the device will function as a basic USB-to-serial adapter. The RX and TX pads are labeled from the computer’s perspective, so to make use of the USB-to-serial adapter you need to connect the programmer’s RX pad to your target’s TX pin (PD1 on the Orangutan/3pi) and the TX pad to your target’s RX pin (PD0 on the Orangutan/3pi) while in USB-to-serial mode. These pads expect logic-level signals (i.e. 0 V lows, 5 V highs).
Programmer Mode:
When the blue mode jumper spans the two pins that are marked on the bottom of the board with a “P”, the computer’s RX line is connected to the programming microcontroller and the device will function as an in-circuit AVR ISP programmer. The computer’s TX line is always connected to both the pad labeled TX and the programming microcontroller.
Revision Number: There are currently two versions of the Orangutan USB Programmer: PGM02A and PGM02B. The programmer’s revision number is written along the right side of the bottom of the PC board. The newer PGM02B revision has two key improvements over the original PGM02A: 1) it has the ability to accept rmware updates from Pololu (see Section 8) and
2) it won’t let you program your target device if that device is not powered, which can help prevent you from accidentally damaging your Orangutan/3pi. Please take note of your programmer’s revision number so you know which statements in this user’s guide apply to your specic programmer.
LEDs:
The green USB status LED near the mini-B connector will light when the Orangutan USB programmer is connected to a personal computer and functioning properly as a serial port. If you have not installed the programmer’s drivers before connecting it, this status LED will be o.
The red and green programming status LEDs near the center of the board will give you feedback when the Orangutan USB programmer is being used in programming mode. The green LED will ash every time the programmer receives a valid AVR ISP command packet from the personal computer to which it is connected. The red LED will ash every time the programmer sends information over the 6-pin ISP cable to the device being programmed. These LEDs do not do anything when the Orangutan USB programmer is in USB-to-serial mode.
3. Module Pinout and Components Page 4 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation
If you have programmer version PGM02B, you will have additional LED feedback. Every time your programmer powers up (i.e. when you connect it to your computer), the red and green status LEDs will both light for ve seconds. During this period, the programmer is receptive to rmware updates; you should avoid trying to program until the initial ve seconds have elapsed and the two status LEDs have turned o. Additionally, if your programmer is not connected to a target device or if your target device is not powered, the programmer’s red LED will ash once per second to indicate that it will not let you program.
Connecting to Your 3pi Robot:
The Orangutan USB programmer connects to your 3pi robot via the included 6-pin ISP cable, which plugs into the 3pi’s keyed ISP port located just behind the right wheel as shown above.
Connecting to Your Orangutan:
Baby Orangutan ISP pins.
Orangutan SV-168, SV-328, and LV-168 ISP pins. Orangutan ISP pins
The Orangutan USB programmer connects to your Orangutan or Baby Orangutan via the included 6-pin ISP cable. The cable must be oriented so that the programmer’s ISP header pin 1 connects to your (Baby) Orangutan’s ISP header pin 1. Unlike the Orangutan, the Baby Orangutan does not come with a shrouded header to enforce correct cable orientation; the red wire and arrow mark on the cable’s ISP connector should be lined up with the arrow to pin 1 on the Baby Orangutan PCB. You will only be able to achieve this alignment by connecting to the top side of the Baby Orangutan PCB, so be very careful not to solder your 6-pin ISP header onto the wrong side of your Baby Orangutan!
3. Module Pinout and Components Page 5 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation
Note: The programmer does not deliver power to the device it is
programming, so your Orangutan must be turned on to be programmed. If you are using programmer version PGM02A, attempting to program an unpowered device will have unpredictable results; this might randomly change the fuse settings, which can in turn permanently disable your Orangutan (see Fuses in Section 5.b). If your programmer version is
PGM02B, the programmer will not let you program an unpowered device (you will see the red status LED blink once per second if your target device is not powered). You must still take great care to ensure that your target device does not lose power during programming.
3. Module Pinout and Components Page 6 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation

4. USB-to-Serial Drivers

Before you connect your Orangutan USB programmer to your computer, you must install the driver [http://www.pololu.com/docs/0J7/] for the programmer’s CP2102 USB-to-UART
bridge. Once you have successfully installed your this driver, you should see the green USB status LED near the mini-B connector lit whenever it is connected to your computer.
4. USB-to-Serial Drivers Page 7 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation

5. Getting Started Using Windows

After you’ve installed the necessary drivers, the next step is to download and install a compiler. WinAVR, located at http://winavr.sourceforge.net/ [http://winavr.sourceforge.net/], is an open source suite of software development tools for the Atmel AVR series of microcontrollers. It includes the GNU GCC compiler for C and C++. Follow the installation instructions they provide.
WinAVR alone will give you all the tools you need to start programming your Orangutan or 3pi robot, but Atmel oers AVR Studio, a free integrated development environment that works with the GCC C/C++ compiler. AVR Studio includes a simulator and other useful tools, and supports the AVR ISP protocol used by the Orangutan USB programmer. You can download AVR Studio from http://www.atmel.com/avrstudio/ [http://www.atmel.com/
avrstudio/]. Follow Atmel’s installation instructions. Note that newer versions of AVR Studio
might not work with older versions of WinAVR, so we recommend you upgrade to the newest version WinAVR every time you get a new version of AVR Studio.

5.a. Using AVR Studio

Here we will show you step by step how to use AVR Studio to make the red user LED blink on your Orangutan, Orangutan SV-168, Orangutan SV-328, Orangutan LV-168, Baby Orangutan, or 3pi robot. Please note that this program will not work on the Orangutan X2. If you want to skip the steps that set up the LED-blinker code and jump straight into using your Orangutan USB programmer, you can download the AVR Studio project these steps would help you create and proceed straight to step 4.
• mega48: BlinkLED_m48.zip [http://www.pololu.com/le/download/
BlinkLED_m48.zip?le_id=0J188] (9k zip)
• mega168: BlinkLED_m168.zip [http://www.pololu.com/le/download/
BlinkLED_m168.zip?le_id=0J189] (9k zip)
• mega328: BlinkLED_m328.zip [http://www.pololu.com/le/download/
BlinkLED_m328.zip?le_id=0J190] (9k zip)
1. Open AVR Studio and click New Project. Select AVR GCC for the project type. We called our project “BlinkLED” and elected to have a folder called “C:\BlinkLED” created containing the blank le “BlinkLED.c”. Click Next >>. DO NOT click “Finish” yet. If you do accidentally click “Finish”, you will not be able to perform step 2 and will instead have to set the device by going to the “Project” menu and selecting “Conguration Options”.
5. Getting Started Using Windows Page 8 of 29
Pololu Orangutan USB Programmer User's Guide © 2001–2010 Pololu Corporation
Creating a new AVR Studio project, step 1
2. Select AVR Simulator as the debug platform and then select the appropriate device for your Orangutan or 3pi. This will either be ATmega48, ATmega168, or ATmega328P depending on which chip your Orangutan or 3pi has. Click Finish.
Creating a new AVR Studio project, step 2
3. Write your program in BlinkLED.c as seen in the screen shot below and click the Build button on the toolbar (or press F7), or just download the zipped BlinkLED project archive for your device from the list above.
5. Getting Started Using Windows Page 9 of 29
Loading...
+ 20 hidden pages