beautypg.com

Getting started in linux, A. linux driver, B. programming avrs in linux – Pololu USB AVR User Manual

Page 35: A. linux driver 4.b. programming avrs in linux

background image

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. All of the parameters that can be set in
the configuration utility are stored in persistent memory, so Linux users only have to use Windows when they want to
change those parameters, which should not be too often.

The SLO-scope client is written for Windows, and there is no Linux version; Linux users are unable to use the SLO-
scope at this time.

If you would like to write a configuration utility or SLO-scope application for Linux, you can

contact us

[http://www.pololu.com/contact]

for information.

4.a. Linux Driver

No driver installation is necessary to use the Pololu USB AVR Programmer in Linux. The Linux Kernel comes with a
USB-to-serial driver (the cdc_acm module) that automatically works with the programmer. (The source code for this
driver is in the kernel source under drivers/usb/class/cdc-acm.c.)

When you plug your programmer into a Linux computer, the CDC ACM driver should automatically detect it and
create two serial port devices. Unless you have other devices plugged in that use the CDC ACM driver, the names of
these two serial port devices should be /dev/ttyACM0 for the programming port and /dev/ttyACM1 for the USB-to-
TTL-serial adapter.

If the programmer is plugged in, but you do not see these devices, please see Troubleshooting (

Section 8

) for help

identifying and fixing the problem.

4.b. Programming AVRs in Linux

If you have an Orangutan or 3pi Robot or wish to use the Pololu AVR C/C++ Library for some
other reason, we recommend following the

Pololu AVR Programming Quick Start Guide

[http://www.pololu.com/docs/0J51]

instead of this tutorial.

To program AVRs in Linux using the Pololu USB AVR Programmer, you will need to install four software packages,
which can be downloaded from their respective websites. In Ubuntu Linux, these packages are provided in the
“Universe” repository.

1. gcc-avr: the GNU C compiler, ported to the AVR architecture

2. avr-libc: a library giving access to special functions of the AVR

3. binutils-avr: tools for converting object code into hex files

4. avrdude: the software to drive the programmer

Once these packages are installed, you will be able to compile C programs for the AVR with gcc to produce hex files.
These hex files can be loaded on to your AVR using avrdude and a programmer.

We will not go into the details of writing C programs for the AVR here, but, as an example, we will show you
how to use your Linux computer and the USB AVR Programmer to make an LED connected to PD1 of an AVR
blink. On any of the Orangutan

robot controllers

[http://www.pololu.com/category/8/robot-controllers]

and the

3pi Robot

Pololu USB AVR Programmer User's Guide

© 2001–2014 Pololu Corporation

4. Getting Started in Linux

Page 35 of 54