avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] getting started with AVRDUDE on STK500


From: Irving Ruan
Subject: Re: [avr-chat] getting started with AVRDUDE on STK500
Date: Thu, 6 Aug 2009 13:43:34 -0700

Wally - I'll check that out. I've heard of it before but never thought of it as a viable tool (lack of information on my part). Thanks.

Joerg - I appreciate the detailed responses. As for RS-232/USB adapters out there, I think the one I currently have is a bit flaky and bad. Do you know any good ones that could work well with linux by any chance?

- Irving


On Wed, Aug 5, 2009 at 10:42 PM, Joerg Wunsch <address@hidden> wrote:
Irving Ruan <address@hidden> wrote:

> I have an STK500 (ATmega324p) and a USB to RS-232 adapter.

In that case, your operating system is allocating a TTY device entry
for the adapter.  That's what you have to use.

> I have the
> libusb-dev package on ubuntu 9.04, and have avrdude compiled.

libusb is not even needed in that case, it's only needed for those
programmers that don't use the TTY abstraction layer.

> What
> steps/precautions should I take from here on out?

Depending on the way your Makefile has been created, it might already
contain precautions to run avrdude (usually as the "program" target).

For a start, just type "man avrdude". ;-)

The plain command is

avrdude -p <your MCU type> -c stk500v2 -P /dev/ttyUSB<N> \
-B<M> -U <your input file to program>

<your MCU type> is whatever AVR type you are trying to program.
Makefiles normally do know that already, as they also have to tell it
(as -mmcu=) to the compiler.

<N> is (obviously) whatever your OS assigns the USB/RS-232 adapter.

<M> is the ISP clock cycle time to tell the STK500, so 1/<M> is the
ISP frequency.  The ISP frequency must always be less than 1/4 of the
CPU clock frequency.  As all AVRs ship with a 1 MHz RC oscillator
enabled (very few with 1.2 MHz), you have to be well below 250 kHz (to
allow for RC oscillator frequency tolerances).  Usually, the value 10
(corresponding to 100 kHz) is a safe, conservative default to use.  If
you intend to run your AVR at a higher clock speed (by modifying
fuses), you can afterwards increase the ISP frequency to speed up the
communication.

<your input file to program> is the loadable file, usually in Intel
Hex format.  (Note that the -U option shown is the shortened form to
just program the flash ROM contents; there's a longer form of the
option arguments to allow for programming arbitrary memory areas
inside the target AVR.  See the manual.)

> Can avrdude be integrated
> with CodeBlocks IDE on linux?

Don't know, I'm an old-time Emacs user. ;-)  It can be easily
integrated into Makefiles (for example, the Mfile template supports
this), so if you can tell Code::Blocks about a custom Makefile target
to run, it should be trivial to integrate.

--
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)


_______________________________________________
AVR-chat mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-chat



--
Irving Y. Ruan
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]