0% found this document useful (0 votes)
35 views

Instructions For Programming in Linux: Erts Lab IIT Bombay

The document provides instructions for programming a robotics competition using Linux. It lists the applications needed for Linux programming as gcc-avr, avr-libc, and avrdude, which can be installed with a single command. It describes compiling C code with avr-gcc and programming the microcontrollers on the robot with avrdude, providing specific commands for the ATmega2560 and ATmega328p microcontrollers.

Uploaded by

Ashish Dahare
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Instructions For Programming in Linux: Erts Lab IIT Bombay

The document provides instructions for programming a robotics competition using Linux. It lists the applications needed for Linux programming as gcc-avr, avr-libc, and avrdude, which can be installed with a single command. It describes compiling C code with avr-gcc and programming the microcontrollers on the robot with avrdude, providing specific commands for the ATmega2560 and ATmega328p microcontrollers.

Uploaded by

Ashish Dahare
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like