starting with AVR-GCC

  1. get the avr-gcc, avr-libs and avr-binutils
  2. create a new folder and add these files:
    • Makefile

      Unable to display file "http://darcs.erazor-zone.de/avr/avr-gcc/avrledtest/Makefile": It may not exist, or permission may be denied.

    • avrledtest.c

      Unable to display file "http://darcs.erazor-zone.de/avr/avr-gcc/avrledtest/avrledtest.c": It may not exist, or permission may be denied.

Some short explanations at this point

Makefile

Well, the Makefile is used to compile your C-source just by typing 'make' as you can see, that will create the avrledtest.hex by executing:

  1. $(CC) $(CFLAGS) -Os -c avrledtest.c
  2. $(CC) $(CFLAGS) -o avrledtest.out -Wl,-Map,avrledtest.map avrledtest.o
  3. $(OBJCOPY) -R .eeprom -O ihex avrledtest.out avrledtest.hex

Additionally you can use 'make load' for uploading your firmware to the device.

  • $(CC) means our c- compiler, thats 'avr-gcc'.
  • $(MCU) thats the type of our microcontroler.
  • $(OBJCOPY) is used to convert the binary .o file to a ascii .hex file

avrledtest.c

Thats quite an easy AVR program, it uses the 2 loops, the while-loop is a simple infinete loop, the next one (for-loop) is used to shift the PORD and other 2 simply slow down the whole thing.

additional links

FAQ - Frequently Asked Questions

Copyright

 
wiki/projects/avr/avr-gcc.txt · Last modified: 2005/09/25 17:57 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki