embeded/AVR (ATmega,ATtiny)2009. 4. 20. 00:37
패러럴이면 STK-200 호환
USB면 STK-500 호환이라고 한다.


Valid programmers are:
  c2n232i  = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts [/usr/local/etc/avrdude.conf:834]
  dasa3    = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [/usr/local/etc/avrdude.conf:821]
  dasa     = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [/usr/local/etc/avrdude.conf:808]
  siprog   = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [/usr/local/etc/avrdude.conf:795]
  ponyser  = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts [/usr/local/etc/avrdude.conf:782]
  89isp    = Atmel at89isp cable            [/usr/local/etc/avrdude.conf:749]
  frank-stk200 = Frank STK200                   [/usr/local/etc/avrdude.conf:735]
  blaster  = Altera ByteBlaster             [/usr/local/etc/avrdude.conf:722]
  ere-isp-avr = ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf> [/usr/local/etc/avrdude.conf:712]
  atisp    = AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/>  [/usr/local/etc/avrdude.conf:702]
  dapa     = Direct AVR Parallel Access cable [/usr/local/etc/avrdude.conf:691]
  xil      = Xilinx JTAG cable              [/usr/local/etc/avrdude.conf:678]
  futurlec = Futurlec.com programming cable. [/usr/local/etc/avrdude.conf:661]
  abcmini  = ABCmini Board, aka Dick Smith HOTCHIP [/usr/local/etc/avrdude.conf:651]
  picoweb  = Picoweb Programming Cable, http://www.picoweb.net/ [/usr/local/etc/avrdude.conf:641]
  sp12     = Steve Bolt's Programmer        [/usr/local/etc/avrdude.conf:630]
  alf      = Nightshade ALF-PgmAVR, http://nightshade.homeip.net/ [/usr/local/etc/avrdude.conf:614]
  bascom   = Bascom SAMPLE programming cable [/usr/local/etc/avrdude.conf:604]
  dt006    = Dontronics DT006               [/usr/local/etc/avrdude.conf:594]
  pony-stk200 = Pony Prog STK200               [/usr/local/etc/avrdude.conf:582]
  stk200   = STK200                         [/usr/local/etc/avrdude.conf:566]
  bsd      = Brian Dean's Programmer, http://www.bsdhome.com/avrdude/ [/usr/local/etc/avrdude.conf:555]
  pavr     = Jason Kyle's pAVR Serial Programmer [/usr/local/etc/avrdude.conf:547]
  dragon_dw = Atmel AVR Dragon in debugWire mode [/usr/local/etc/avrdude.conf:540]
  dragon_hvsp = Atmel AVR Dragon in HVSP mode  [/usr/local/etc/avrdude.conf:532]
  dragon_pp = Atmel AVR Dragon in PP mode    [/usr/local/etc/avrdude.conf:524]
  dragon_isp = Atmel AVR Dragon in ISP mode   [/usr/local/etc/avrdude.conf:516]
  dragon_jtag = Atmel AVR Dragon in JTAG mode  [/usr/local/etc/avrdude.conf:508]
  jtag2dw  = Atmel JTAG ICE mkII in debugWire mode [/usr/local/etc/avrdude.conf:500]
  jtag2isp = Atmel JTAG ICE mkII in ISP mode [/usr/local/etc/avrdude.conf:492]
  jtag2    = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:484]
  jtag2fast = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:476]
  jtag2slow = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:468]
  jtagmkII = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:460]
  jtag1slow = Atmel JTAG ICE (mkI)           [/usr/local/etc/avrdude.conf:453]
  jtag1    = Atmel JTAG ICE (mkI)           [/usr/local/etc/avrdude.conf:445]
  jtagmkI  = Atmel JTAG ICE (mkI)           [/usr/local/etc/avrdude.conf:437]
  avr911   = Atmel AppNote AVR911 AVROSP    [/usr/local/etc/avrdude.conf:431]
  avr109   = Atmel AppNote AVR109 Boot Loader [/usr/local/etc/avrdude.conf:425]
  butterfly = Atmel Butterfly Development Board [/usr/local/etc/avrdude.conf:419]
  usbtiny  = USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/ [/usr/local/etc/avrdude.conf:413]
  usbasp   = USBasp, http://www.fischl.de/usbasp/ [/usr/local/etc/avrdude.conf:407]
  avr910   = Atmel Low Cost Serial Programmer [/usr/local/etc/avrdude.conf:401]
  stk600hvsp = Atmel STK600 in high-voltage serial programming mode [/usr/local/etc/avrdude.conf:395]
  stk600pp = Atmel STK600 in parallel programming mode [/usr/local/etc/avrdude.conf:389]
  stk600   = Atmel STK600                   [/usr/local/etc/avrdude.conf:383]
  stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode [/usr/local/etc/avrdude.conf:377]
  stk500pp = Atmel STK500 V2 in parallel programming mode [/usr/local/etc/avrdude.conf:371]
  stk500v2 = Atmel STK500 Version 2.x firmware [/usr/local/etc/avrdude.conf:365]
  mib510   = Crossbow MIB510 programming board [/usr/local/etc/avrdude.conf:359]
  stk500v1 = Atmel STK500 Version 1.x firmware [/usr/local/etc/avrdude.conf:353]
  stk500   = Atmel STK500                   [/usr/local/etc/avrdude.conf:347]
  avrisp2  = Atmel AVR ISP mkII             [/usr/local/etc/avrdude.conf:337]
  avrispmkII = Atmel AVR ISP mkII             [/usr/local/etc/avrdude.conf:331]
  avrispv2 = Atmel AVR ISP V2               [/usr/local/etc/avrdude.conf:325]
  avrisp   = Atmel AVR ISP                  [/usr/local/etc/avrdude.conf:319]
  arduino  = Arduino                        [/usr/local/etc/avrdude.conf:313]



Posted by 구차니
embeded/AVR (ATmega,ATtiny)2009. 4. 15. 00:17

avrdude를 막상 사용해보려니 막막해서.. 일단 이런녀석을 찾아 보게 되었다.
이거 말고도 존재하지만, 막상 실행하보니 윈도우용.. gnome용이나 Xwindow용으로 할 방법이 딱히 보이지 않아서
(게다가 g++도 설치가 되어 있지 않으니 ㄱ-) 포기를 할까 하다가 구글에서 조금 더 찾아 보니
gnome-avrdude라는 것을 발견하게 되었다.  아무튼 이녀석으로 나중에 AVR 읽어 보는 테스트를 해봐야겠다.

[발견 : korean.osstrans.net/software/gnome-avrdude.html]
[gnome-avrdude : http://sourceforge.net/projects/gnome-avrdude]

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ubuntu에서 gnome-avrdude 사용하기  (0) 2009.05.27
STK-200 / STK-500 호환 AVR ISP  (2) 2009.04.20
linux에서 AVR 컴파일하기  (0) 2009.04.07
어셈블리 언어 ORG 명령  (4) 2009.03.19
AVR Studio / AVR-GCC 뜯어 보기  (0) 2008.11.18
Posted by 구차니
linux에서는 gcc에서 옵션으로 지원을 한다고 한다.

AVR Options - Using the GNU Compiler Collection (GCC)

3.17.23 AVR Options

These options are defined for AVR implementations:

-mmcu=mcu
Specify ATMEL AVR instruction set or MCU type.

Instruction set avr1 is for the minimal AVR core, not supported by the C compiler, only for assembler programs (MCU types: at90s1200, attiny10, attiny11, attiny12, attiny15, attiny28).

Instruction set avr2 (default) is for the classic AVR core with up to 8K program memory space (MCU types: at90s2313, at90s2323, attiny22, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515, at90c8534, at90s8535).

Instruction set avr3 is for the classic AVR core with up to 128K program memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).

Instruction set avr4 is for the enhanced AVR core with up to 8K program memory space (MCU types: atmega8, atmega83, atmega85).

Instruction set avr5 is for the enhanced AVR core with up to 128K program memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323, atmega64, atmega128, at43usb355, at94k).

-msize
Output instruction sizes to the asm file.
-minit-stack=N
Specify the initial stack address, which may be a symbol or numeric value, `__stack' is the default.
-mno-interrupts
Generated code is not compatible with hardware interrupts. Code size will be smaller.
-mcall-prologues
Functions prologues/epilogues expanded as call to appropriate subroutines. Code size will be smaller.
-mno-tablejump
Do not generate tablejump insns which sometimes increase code size.
-mtiny-stack
Change only the low 8 bits of the stack pointer.


[링크 : http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/AVR-Options.html]

avrprog는 2001년 6월 이후로 업데이트 안되고 있고, avrdude가 계속 유지 되고 있는 듯 보인다.

[AVRPROG : http://sourceforge.net/projects/avrprog/]
[AVRDUDE : http://savannah.nongnu.org/projects/avrdude]
[gnome-avrdude : http://sourceforge.net/projects/gnome-avrdude]


아쉽게도 AVR Studio는 AVR32(32bit 버전)용 밖에 없다.

  AVR32 GNU Toolchain 2.1.6 - Linux Fedora 9 (27 MB, revision 2.1.6, updated 3/09) RPMs for Fedora Core 9.
  AVR32 Studio 2.1.1 for Linux (249 MB, revision 2.1.1, updated 2/09) AVR32 Studio package for Linux.
[atmel official : http://www.atmel.com/dyn/products/tools.asp?family_id=682]

참고 링크
[링크 : http://picky9.com/blog/entry/223]

Posted by 구차니
embeded/AVR (ATmega,ATtiny)2009. 3. 19. 16:38
The ORG command is a standard (almost universal) command that tells the assembler where the program is to reside in memory

ORG 명령어는 메모리에 상주할 프로그램의 주소를 알려준다고 되어 있는데,
JMP 와는 다른 듯 한데 무슨 차이일려나..

[출처 :  www.ordersomewherechaos.com/rosso/fetish/m102/web100/docs/assemb-tutorial.html]
링크가 깨져, 구글에서 저장된 페이지로 보시기 바랍니다.


23. ORG
Label     Operation   Operand
optional     ORG      expression

The ORG directive instructs the assembler to continue the assembly from the
memory location specified by the operand. The operand must be an expression
that can be immediately evaluated, and its value must be a valid address (i.e., it
cannot be negative). Thus the operand can be a number, a known symbol, or an
expression that can be evaluated by the assembler at this point. Such an operand
is called “definable.”

[출처 : http://www.davidsalomon.name/assem.advertis/asl.pdf]


ORG expression
Sets the location counter to expression.
[출처 : MASM reference]
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2008. 11. 18. 00:15

AVR Studio 에서는 상당 부분이 자동으로 생성된다. (source가 아니라 makefile)
AVR 프로그래밍 처음 단계는 아마도
#include <avr/io.h>가 아닐까 싶은데 이부분을 추적을 해 보았다.

makefile - 자동생성

MCU 에 AVR Studio에서 프로젝트 생성시 선택된 프로세서의 타입이 지정되고
아래의 COMMON 에 -mmcu=atmega128 로 확장이 된다. 일단 avr-gcc의 도움말을 보자면

Usage: avr-gcc [options] file...
Options:
  -pass-exit-codes         Exit with highest error code from a phase
  --help                   Display this information
  --target-help            Display target specific command line options
  --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]
                           Display specific types of command line options
  (Use '-v --help' to display command line options of sub-processes)
  -dumpspecs               Display all of the built in spec strings
  -dumpversion             Display the version of the compiler
  -dumpmachine             Display the compiler's target processor
  -print-search-dirs       Display the directories in the compiler's search path

  -print-libgcc-file-name  Display the name of the compiler's companion library
  -print-file-name=<lib>   Display the full path to library <lib>
  -print-prog-name=<prog>  Display the full path to compiler component <prog>
  -print-multi-directory   Display the root directory for versions of libgcc
  -print-multi-lib         Display the mapping between command line options and
                           multiple library search directories
  -print-multi-os-directory Display the relative path to OS libraries
  -print-sysroot-headers-suffix Display the sysroot suffix used to find headers
  -Wa,<options>            Pass comma-separated <options> on to the assembler
  -Wp,<options>            Pass comma-separated <options> on to the preprocessor

  -Wl,<options>            Pass comma-separated <options> on to the linker
  -Xassembler <arg>        Pass <arg> on to the assembler
  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor
  -Xlinker <arg>           Pass <arg> on to the linker
  -combine                 Pass multiple source files to compiler at once
  -save-temps              Do not delete intermediate files
  -pipe                    Use pipes rather than intermediate files
  -time                    Time the execution of each subprocess
  -specs=<file>            Override built-in specs with the contents of <file>
  -std=<standard>          Assume that the input sources are for <standard>
  --sysroot=<directory>    Use <directory> as the root directory for headers
                           and libraries
  -B <directory>           Add <directory> to the compiler's search paths
  -b <machine>             Run gcc for target <machine>, if installed
  -V <version>             Run gcc version number <version>, if installed
  -v                       Display the programs invoked by the compiler
  -###                     Like -v but options quoted and commands not executed
  -E                       Preprocess only; do not compile, assemble or link
  -S                       Compile only; do not assemble or link
  -c                       Compile and assemble, but do not link
  -o <file>                Place the output into <file>
  -x <language>            Specify the language of the following input files
                           Permissible languages include: c c++ assembler none
                           'none' means revert to the default behavior of
                           guessing the language based on the file's extension

Options starting with -g, -f, -m, -O, -W, or --param are automatically
 passed on to the various sub-processes invoked by avr-gcc.  In order to pass
 other options on to these processes the -W<letter> options must be used.

For bug reporting instructions, please see:
<URL:http://sourceforge.net/tracker/?atid=520074&group_id=68108&func=browse>.

-m 의 경우 avr-gcc 에 의해서 생성된 하위 프로세서로 자동적으로 넘겨져서 처리가 된다고 한다.
아무튼 처음에 설정하는 <avr/io.h> 는 컴파일러의 include 디렉토리에 위치하는데
기본값으로 설치를 했다면 아래의 경로에 위치하게 된다.


이 파일들 중에서 우리가 보고 싶은것은 io.h 인데 이 파일을 열어 보면


와 같이 #if #elif 로 묶여 있고 그 중에 우리가 찾던
__AVR_ATmega128__ 이라는 선언이 존재 한다. 아마도 -mmcu=atmega128이 이런식으로 치환이 되는 듯 하다.


아무튼 치환될 iom128.h 파일을 열어 보면 우리가 사용하는 일반적인 용어(!) 인
PINA DDRA 등의 선언과 그 에 상응하는 주소를 볼 수 있다.
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2008. 11. 10. 00:21
요즘에는 대부분의 메인보드에 USB만 있을뿐 LPT(패러럴)나 COM(시리얼)이 없는 경우도 상당히 많다.
하지만 AVR을 프로그래밍 하려면 롬 라이터가 있어야 하는데,
이 장비의 경우 고가인데다가, 칩의 핀수에 맞는 커넥터를 구매 하여야 한다.

그런 이유로 현실적인 대안은 USB 시리얼/패러럴이나
시리얼 / 패러럴이 달린 구형 메인보드, 혹은 최상급의 메인보드를 구매 해야 한다.

그렇다고 하기에는 이래저래 돈이 많이 드는 관계로 조금이라도 덜 들고 편한쪽을 택하라면
USB ISP를 구매 하는게 좋을듯 하다.

유니텍의 경우 패러럴 포트를 내부에 26핀으로 별도로 꺼내서 유니텍에서 별도 판매 하는
패러럴 포트를 구매 하면 되지만, 이래저래 가격 부담도 크고, 유니텍스럽게 택배비는 착불이라서 기분도 나쁘고
그냥 USB ISP를 사는게 가장 효율적인 방안으로 생각이 된다.


---
나머지는 구매 후 적도록 ^^;
STK-500 이라는 것과 호환이 되고, USB-ISP 역시 일종의 USB 시리얼로 COM포트로 인식하고
(보드는 USB 시리얼 + STK500 제어용 칩으로 구성) 시리얼로 프로그램을 전송한다.
데이터 시트 상으로는 시리얼 프로그래밍에 관한 항목이 있으므로 이부분을 좀더 읽어 봐야 할 듯 하다.
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2008. 11. 7. 23:05
결론 : 실패
원인 : 아직 모름..

일단 Ponyprog에서 포트 자동 탐지를 끄라고 한다.
  • PonyProg2000 (Freeware programmer esp. for PIC, ATmega, serial EEPROMs)
    • The INI file must be modified to get PonyProg to work: change „AutoDetectPorts=NO“!

[출처 : http://www-user.tu-chemnitz.de/~heha/bastelecke/Rund%20um%20den%20PC/USB2LPT/liste.htm.en]

일단 ponyprog.ini의 내용은 아래와 같다.



그리고 나서 해보니 먼가 되는듯한데.. 여전히 -16오류, 장치를 발견하지 못한다고 한다.
그래서 계속 검색을 해보니.. 그런 이유로 USB ISP가 나온거라는 식으로 되어 있어서 좌절 OTL

USB LPT / 도킹 전부 임베디드 장비에서 패러럴이 아닌 프린트 포트로 인식을 해서 안된대나..
일부 외국산 장비중에는 인식하는것도 있지만 강원전자꺼는 드라이버 문제인지 안된다고 한다.

[링크 : http://kldp.org/node/46808]
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2008. 10. 28. 09:59
근 2일간을 고생하게 한 문제인데.. 이 문제를 해결하기 위해서 무려 AVR Studio 신버전을 받는데 1시간이나 걸리고,
WinAVR 마저도 업그레이드 했지만..(머.. 덕분에라고 하면 다행인가?) 문제가 해결되지 않았다.

예전에도 AVR Studio를 사용할때 이러한 문제가 없었는데 왜 이번에는 생겼을까 고심을 해봤더니
예전에는 c:\source에 저장을 했었다는 점이 달랐을뿐 차이점이 없었다.

그래서 오늘 출근하면서 지하철에서 실험을 해봤더니. AVR Studio 인지 아니면 avr-gcc plug 쪽인지는 모르겠지만
아무튼 Makefile export 하는 쪽에서 한글 디렉토리명을 인식하지 못한다는 점을 알아 냈다.


아래의 Message를 보면 gcc plug-in : Exported makefile to.. 영문으로된 경로로는 이상이 없었지만
동일한 파일을 한글 디렉토리가 들어간 경로에 저장을 하려고 하면 Failed opening file 이라고 에러를 발생한다.
Posted by 구차니