beautypg.com

Lock bits, D. programming avrs using avrdude, E. configuring the programmer – Pololu USB AVR User Manual

Page 31: Section 3.e

background image

Lock Bits

Clicking on the Lock Bits tab automatically causes the programmer to read the lock bits of the target AVR. If the
programmer is not connected to the target AVR when you select this tab, AVR Studio displays an error message. Lock
bits allow you to secure your AVR by preventing further flash writing or reading. The lock bits can be reset to a fully
unlocked state by performing a chip erase (i.e. by clicking the Erase Device button in the Main tab). Lock bits are
usually only important if you wish to release a product to other people without giving them access to the program it
is running, or if you wish to make it more difficult to accidentally overwrite a programmed chip.

3.d. Programming AVRs Using AVRDUDE

It is possible to program AVRs in Windows using

AVRDUDE

[http://www.nongnu.org/avrdude/]

. AVRDUDE is free and

included in the

WinAVR

[http://winavr.sourceforge.net/]

package. To program a hex file onto your AVR, you would type

something similar to the following into a command prompt:

cd C:\BlinkLED\Debug

avrdude -p m328p -P COM2 -c avrispv2 -U flash:w:BlinkLED.hex

• The argument following the -p is the part number of the AVR. For an Orangutan or 3pi Robot, the part number
should be m328p, m1284p, m324p, m644p, m168, or m48.

• The argument following the -P is the port name. You can determine your programmer’s port name by looking
in the “Ports (COM & LPT)” list of your Device Manager for “Pololu USB AVR Programmer Programming
Port”. Using

\\.\USBSER000

will also usually work.

• The argument following the -c is the programmer protocol and should be avrispv2.

• The -U option is used for writing, reading, or verifying flash, EEPROM, fuses, or lock bits. In this example
we are using -U to write BlinkLED.hex to flash.

Please see the

AVRDUDE documentation

[http://www.nongnu.org/avrdude/user-manual/avrdude.html]

for more detailed

information.

AVRDUDE’s terminal mode (the -t option) is not compatible with the programmer because the
programmer will exit programming mode and release the target AVR from reset if it receives no
programming commands for 1400 ms.

3.e. Configuring the Programmer

The Pololu USB AVR programmer can be configured using the Pololu USB AVR Programmer Configuration Utility
for Windows. The utility comes with the Windows drivers (

Section 3.a

). You can run it from your Start Menu, or by

just double clicking on the executable pgm03a_config.exe. This section describes all the available settings and what
they do.

Pololu USB AVR Programmer User's Guide

© 2001–2014 Pololu Corporation

3. Getting Started in Windows

Page 31 of 54