tohsin / embedded_atmega

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup and devices used for this repo

link

Programmer 1

Using AVR Boards man avr-gcc

Compile

avr-gcc -mmcu=atmega328 blink.c

Compile Without linking

avr-gcc -c -mmcu=atmega328 helper.c

Combine Machine Code files

avr-gcc -mmcu=atmega328 blink.o helper.o

Optimise diff options

  1. For size

avr-gcc -mmcu=atmega328 blink.c

Convert To hex

avr-objcopy -O ihex -j.text -j.data a.out a.hex

Avr dude location

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf

Flash program to Chip

avrdude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -p atmega328p -c USBasp -U flash:w:a.hex

Bash File for all 3 prcoesses

chmod +x compile_upload.sh
./compile_upload.sh /path/to/blink.c

About


Languages

Language:C 59.0%Language:C++ 38.7%Language:Shell 2.3%