Robotics Competition
2018
Instructions for Programming in Linux
In case you want to use Linux OS, you first need to have following applications installed on the
Linux machine:
1. Install gcc-avr
2. Install avr-libc
3. Install avrdude
sudo apt-get install gcc-avr avr-libc avrdude
You can use any editor to write program for robot.
1. Commands for compiling the C code using avr-gcc:
avr-gcc -Os -DF_CPU=14745600 -mmcu=atmega2560 -c test.c
avr-gcc -DF_CPU=14745600 -mmcu=atmega2560 -o test.elf test.o
avr-objcopy -O ihex test.elf test.hex
2. Programming ATmega2560 using avrdude
sudo avrdude -c stk500v2 -p m2560 -P /dev/ttyACM0 -U flash:w:test.hex
3. Programming ATmega328p using avrdude
sudo avrdude -p m328p -P /dev/ttyUSB0 -c arduino -b 57600 -v -D -U flash:w:"test.hex":i
Note: Replace test with your filename.
ERTS LAB
IIT Bombay www.e-yantra.org