Avr-gcc
From Attie's Wiki
(Difference between revisions)
Line 23: | Line 23: | ||
avr-gcc avr.c -mmcu=atmega162 -o avr.elf -Wall | avr-gcc avr.c -mmcu=atmega162 -o avr.elf -Wall | ||
avr-objcopy -j .text -O ihex avr.elf avr.hex | avr-objcopy -j .text -O ihex avr.elf avr.hex | ||
− | avrdude -c buspirate -P /dev/ttyUSB1 -x speed= | + | avrdude -c buspirate -P /dev/ttyUSB1 -x speed=3 -p m168 -U flash:w:avr.hex |
</pre> | </pre> | ||
Resources: | Resources: | ||
http://arduino.cc/en/Hacking/PinMapping168 | http://arduino.cc/en/Hacking/PinMapping168 |
Revision as of 00:10, 25 March 2010
How to setup avr-gcc and get compiling for an Arduino!
$ yum install avr-gcc avr-libc avrdude
For ATMega168:
$ avrdude -c buspirate -P /dev/ttyUSB1 -x speed=3 -p m168
For ATMega328p:
$ avrdude -c buspirate -P /dev/ttyUSB1 -x speed=3 -p m328p
Terminal mode: -t
. Use command part
to see detailed part information.
To upload file: -U memtype:op:filename[:format]
Simple makefile:
all: avr-gcc avr.c -mmcu=atmega162 -o avr.elf -Wall avr-objcopy -j .text -O ihex avr.elf avr.hex avrdude -c buspirate -P /dev/ttyUSB1 -x speed=3 -p m168 -U flash:w:avr.hex
Resources: http://arduino.cc/en/Hacking/PinMapping168