Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Pololu USB AVR Programmer User's Guide 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.a. Module Pinout and Components . . . . . . . . . . . . . 1.b. Supported Microcontrollers . . . . . . . . . . . . . . . . 1.c. Supported Operating Systems . . . . . . . . . . . . . . . 2. Contacting Pololu . . . . . . . . . . . . . . . . . . . . . . . . . 3. Getting Started in Windows . . . . . . . . . . . . . . . . . . . 3.a.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 1. Overview The Pololu USB AVR programmer [http://www.pololu.com/catalog/product/1300] is a programmer for Atmel’s AVR microcontrollers and controller boards based on these MCUs, such as Pololu Orangutan robot controllers [http://www.pololu.com/catalog/category/8] and the 3pi robot [http://www.pololu.com/catalog/product/975].
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 1.a. Module Pinout and Components Pololu USB AVR programmer, labeled top view. The Pololu USB AVR programmer connects to a computer’s USB port via an included USB A to mini-B cable [http://www.pololu.com/catalog/product/130], and it connects to the target device via an included 6-pin ISP programming cable [http://www.pololu.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation The A and B lines can be used as serial control/handshaking lines for the USB-to-TTL-serial adapter (see Section 5.a) or as analog voltage inputs for the SLO-scope (see Section 6). Pololu USB AVR programmer bottom view with dimensions. The USB AVR programmer has a standard 6-pin AVR ISP connector for programming AVRs, and the pins are labeled on the silkscreen on the bottom side of the board. The pins on the connector are: 1.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation have to use Windows when you want to change those parameters, which should be rarely (if ever). The programmer does not require the configuration to program AVRs or to use the TX and RX USB-to-TTL-serial adapter pins. The SLO-scope application works only in Windows. 1.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 2. Contacting Pololu You can check the Pololu USB AVR programmer page [http://www.pololu.com/catalog/ product/1300] for additional information. We would be delighted to hear from you about any of your projects and about your experience with the Pololu USB AVR Programmer. You can contact us [http://www.pololu.com/contact] directly or post on our forum [http://forum.pololu.com/].
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 3. Getting Started in Windows The Pololu USB AVR programmer works in Windows XP, Windows Vista, and Windows 7. 3.a. Installing Windows Drivers and the Configuration Utility If you use Windows XP, you will need to have either Service Pack 3 [http://www.microsoft.com/downloads/ details.aspx?FamilyId=68C48DAD-BC34-40BE-8D85-6BB4F56F5110] or Hotfix KB918365 installed before installing the drivers for the Pololu USB AVR programmer.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Windows Vista and Windows 7 users: After the INF file is installed, your computer should automatically install the necessary drivers when you connect a Pololu USB AVR programmer, in which case no further action from you is required. Windows XP users: After the INF file is installed, follow steps 5-9 for each new Pololu USB AVR programmer you connect to your computer. 5. Connect the USB AVR programmer to your computer’s USB port.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 8. Windows XP will warn you again that the driver has not been tested by Microsoft and recommend that you stop the installation. Click “Continue Anyway”. 9. When you have finished the “Found New Hardware Wizard”, click “Finish”. After that, another wizard will pop up. You will see a total of three wizards when plugging in the programmer. Follow steps 6-9 for each wizard.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 5.1.2600.2930 will not work with the USB AVR programmer. You can check what version of this driver you have by looking in the “Details” tab of the “Properties” window for C:\Windows\System32\drivers\usbser.sys. To get the fixed version of the driver, you will need to either install Service Pack 3 [http://www.microsoft.com/downloads/ details.aspx?FamilyId=68C48DAD-BC34-40BE-8D85-6BB4F56F5110] or Hotfix KB918365.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 3.b. Programming AVRs Using AVR Studio After you’ve installed the necessary drivers, the next step is to download and install a compiler. WinAVR [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++. Please follow the installation instructions they provide.
Pololu USB AVR Programmer User's Guide © 2001–2009 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 target AVR. For an Orangutan or 3pi Robot, this will either be ATmega48, ATmega168, or ATmega328P depending on which chip your Orangutan or 3pi Robot has. Click Finish. Creating a new AVR Studio project, step 2 3. Write your program in BlinkLED.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Building a project with AVR Studio Note: You will probably want to customize this program slightly if the clock frequency of your AVR is not 20 MHz. F_CPU should be defined as the clock frequency of your AVR in units of Hz. If you do not make this change, the timing of delayms() will be off, but the LED will still blink. 4.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation AVR Studio’s programmer-selection dialog If the ISP window does not appear when you click “Connect…”, your computer cannot detect the programmer. Please see Troubleshooting (Section 7) for help identifying and fixing the problem. If AVR Studio brings up a dialog asking if you want to upgrade (or downgrade) your programmer’s firmware, click Cancel to ignore the message and use your programmer.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Reading the device signature in AVR Studio’s Main ISP tab 8. Now it is time to program your target device. Select the Program tab. Your Input HEX File in the Flash section needs to be the hex file that was generated when you built your program. You can browse for this using the "..." button to the right of the input file text box. If you navigate to your project’s folder, you should find it as “default\.hex”.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Reading FLASH .. OK! FLASH contents is equal to file.. OK Leaving programming mode.. OK! If there were no problems, the LED connected to PD1 of your AVR should now be flashing! Note that if you are trying this on a 3pi robot and you have not yet soldered in the optional through-hole LEDs, the flashing LED will be on the bottom of the robot.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation detection level, and the clock off of which it should run (e.g. external crystal or internal oscillator). To learn more about the fuses and what they do, see the datasheet for your specific AVR. Warning: You can permanently disable your AVR by setting the fuses incorrectly.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Pololu USB AVR programmer configuration utility for Windows. Target VDD Monitor The USB AVR programmer monitors the voltage of the target AVR while it is being programmed to ensure that ISP commands are only sent when the AVR’s VDD is at a safe level, since attempting to program an underpowered AVR can permanently disable it.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation ISP Frequency The higher the ISP frequency, the faster you can program the target AVR, but the ISP frequency must be less than a quarter of the target AVR’s clock frequency. The ISP frequency can be set in AVR Studio (see Section 3.b.1) as well as in the Configuration Utility, but the frequencies listed in the AVR Studio user interface do not match the actual frequencies used by the Pololu USB AVR programmer.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation ignore the message and proceed to the AVRISP programming dialog. To prevent this firmware-upgrade dialog from appearing in the future, set the numbers here to the numbers that AVR Studio says it expects. 3.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 4. Getting Started in Linux The Pololu USB AVR programmer can be used in Linux to program AVRs and to send and receive bytes on the USB-to-TTL-serial adapter. The configuration utility is written for Windows; there is no Linux version.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation • mega168: BlinkLED_m168.zip [http://www.pololu.com/file/download/BlinkLED_m168.zip?file_id=0J189] (9k zip) • mega328: BlinkLED_m328.zip [http://www.pololu.com/file/download/BlinkLED_m328.zip?file_id=0J190] (9k zip) If your device is not one of the above, you will need to download one of the above archives and modify the makefile to use your particular device. Unpack the archive on your Linux computer.
Pololu USB AVR Programmer User's Guide avrdude done. © 2001–2009 Pololu Corporation Thank you. rm BlinkLED.o BlinkLED.obj This output indicates the AVR was successfully programmed. The LED connected to PD1 of your AVR should now be flashing! Note that if you are trying this on a 3pi robot and you have not yet soldered in the optional through-hole LEDs, the flashing LED will be on the bottom of the robot. If there was a problem, please see Troubleshooting (Section 7) for help identifying and fixing it.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 5. Communicating via the USB-to-TTL-Serial Adapter One bonus feature of the Pololu USB AVR programmer is the USB-to-TTL-serial adapter, which can be used for connecting microcontroller projects to a personal computer. The programmer’s drivers make the USB-to-TTL-serial adapter look like a standard serial port to the operating system, allowing you to use existing terminal programs and software that are designed to use serial ports.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation will be /dev/ttyACM0). If you see more than two ports, then you should look at the output from dmesg when you plug in the USB AVR programmer to see which two ports are created; the second port is the USB-to-TTL-serial adapter. In Linux, the port name depends on how many other devices are using the USB CDC ACM driver to create virtual serial ports at the time the USB AVR Programmer is plugged in.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation input or an output by identifying it with a serial handshaking line using the programmer’s configuration utility (see Section 3.d). The table below shows which handshaking lines are available (CTS is not available because there is no provision for it in the USB CDC ACM subclass). Direction Name .NET System.IO.Ports.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation if (port.DsrHolding) { MessageBox.Show("Line B is high."); } else { MessageBox.Show("Line B is low."); } // Disconnect from the port so that other programs can use it. port.Close(); When the SLO-scope feature is enabled, it assumes control of pins A and B and uses them as analog inputs (or digital outputs controlled by the SLO-scope application).
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 6. Measuring Voltages Using the SLO-scope A second bonus feature of the Pololu USB AVR programmer is the severely limited oscilloscope (SLO-scope), which uses lines A and B as inputs to measure TTL-level voltages at a sample rate of up to 20 kHz.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation Pololu SLO-scope client for Windows. Controls are available for setting the SLO-scope operating mode, adjusting the horizontal and vertical scales, and configuring lines A and B as digital outputs. To start capturing data, click the Run button in the upper right corner. If the horizontal scale is such that it takes more than 200 ms of data to fill the lower SLO-scope pane, the data will continuously stream across the pane.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation To change the vertical position of the 0V level of a channel, click and drag that channel’s corresponding 0Vindicator triangle on the left side of the lower pane. While the SLO-scope is running, lines A and B do not function as serial handshaking lines as discussed in Section 5.a. Rather, the SLO-scope can control the I/O states of A and B.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation 7. Troubleshooting This section helps solve problems you might have using the Pololu USB AVR programmer. If the computer fails to connect to the programmer: • Make sure your programmer is connected to your computer via a USB A to mini-B cable.
Pololu USB AVR Programmer User's Guide © 2001–2009 Pololu Corporation somewhere on your target device. The ideal way to test for this is to try programming a different device with your USB AVR programmer, or try using a different programmer to program your target device. If this is not an option, try verifying that the target device is still functional and perform some continuity tests to check for shorts or disconnections on the ISP programming lines.