avr-chat
[Top][All Lists]
Advanced

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

[avr-chat] It works! It works!


From: joe
Subject: [avr-chat] It works! It works!
Date: Fri, 1 Jun 2007 20:42:54 -0600

Thanks to the help of all the kind members of this list, I have
successfully uploaded my very first program to an Atmel chip and gotten
it to work!  I'm not compiling or writing my own code yet, but that was
never the scary part for me -- interfacing with the hardware is the
hard part.

For the record, here's what I did to get this to work on Mac OS X:

1. Downloaded OSXAVR from http://sourceforge.net/projects/osxavr/ and
ran the installer.  I chose to put mine in a custom location
(/Applications/3rd-Party/osx-avr), probably because I'm a glutton for
punishment.

2. Updated my ~/.profile file to export the right symbols:

PATH="$PATH:/Applications/3rd-Party/osx-avr/bin:/Applications/3rd-Party/osx-avr/avr/bin"
export PATH

AVR="/Applications/3rd-Party/osx-avr/avr"
export AVR

3. Added symbolic links in /usr/local/lib to point to the things in my
custom osx-avr/lib directory.  Without this step, avrdude would fail to
run, with the error "dyld: Library not loaded:
/usr/local/lib/libusb-0.1.4.dylib".

4. Connected the AVR-ISP2 controller to the ATmega48 chip on my
breadboard.  On the ISP header, pin 1 is the one identified with a
little triangle.  Other pins can be worked out from there following the
diagram shown in ATAVRISP User Guide, and matching up pins to the
ATmega48 by name.  I also added a 0.1uF capacitor bridging the VCC and
GND pins on one side, and the AVCC and GND pins on the other side.

5. cd'd to the directory containing Matthew MacClary's
3-second-all-pins flasher program.  The compiled binary was called
main.hex, which I installed with this incantation:

  avrdude -p m48 -c avrispmkII -P usb -U flash:w:main.hex:i -v

Avrdude chugged a while, printing a lot of output which I'll need to
study at some point, and finally claimed to be done.

6. I shut the board power off, unplugged the AVRISP2 from the USB port,
and disconnected the reset line from the ATmega48; then connected an
LED/resistor to pin 15 (PB1), and then turned power back on.  The light
came on... about a minute later, it's off!  Another minute, it's back
on again!  It works!

(It's cycling every minute because the original code was written to
cycle every 3 seconds at 20 MHz, but I'm running at only 1 MHz, so it's
20 times slower.)

I couldn't be happier if I were twins.  Thanks to everyone for your
help, and I hope this info in the archives is useful to the next person
who tries to dive into this pool!

Best,
- Joe

--
Joe Strout -- address@hidden
Strout Custom Solutions






reply via email to

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