'ATMEGA128'에 해당되는 글 1건

  1. 2012.03.07 [Archlinux] AVR 개발환경 설정 (Atmega128) 7

[Archlinux] AVR 개발환경 설정 (Atmega128)

|

[필요 패키지]
1 community/avr-binutils
    A set of programs to assemble and manipulate binary and object files for the avr architecture
2 community/avr-gcc
    The GNU avr Compiler Collection
3 community/avr-libc
    The C runtime library for the AVR family of microcontrollers
4 community/avrdude
    Download/upload/manipulate the ROM and EEPROM contents of AVR microcontrollers


* 설치
# pacman -S avr-binutils avr-gcc avr-libc avrdude (archlinux)
# apt-get install gcc-avr avr-libc avrdude (ubuntu)

1. 컴파일 (object file 생성)
$ avr-gcc -mmcu=atmega128 -o $(FILE).o $(FILE).c
// -mmcu=atmega128: ATmega128칩셋을 타겟으로 하여 컴파일. 

2. 컴파일 2 (.hex file 생성)
$ avr-objcopy -O ihex $(FILE).o $(FILE).hex
// -O ihex: hex형식으로 생성함.
 
3. 보드에 download
# avrdude -p m128 -c avr910 -b 115200 -P /dev/ttyUSB0 -U flash:w:$(FILE).hex:i
 // DK-128 season2의 경우에 -c (programmer mode)를 avr910으로 설정해 주어야 verifiying에서 통과됨.
// -b (bps)옵션을 넣지 않거나 115200외에 다른 값을 지정하게 되면 오류 발생. 


And
prev | 1 | next