おおむねここを参考にする。
http://jun1chi.blogspot.jp/2011/07/macarduino-atmega168pft232rl.html
ピンアサインはここ。
http://sprocessing.blogspot.jp/2009/01/avrispmkii.html
重要な事実が書いてある。
http://d.hatena.ne.jp/nisuseteuryalus2/20110403
次に、これが意外と盲点なのですが、電池でいいので5V電源を用意します。そしてピンに直接さして外部電源として供給します。
(゜Д゜) ハア??
ここでかなりはまりました。
% avrdude -c avrisp2 -P usb -p t2313 -U flash:w:tiny2313.hex:i -v -B 19200 avrdude: Version 5.11.1, compiled on Aug 10 2012 at 22:53:07 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "/usr/local/Cellar/avrdude/5.11.1/etc/avrdude.conf" User configuration file is "/Users/shohei/.avrduderc" User configuration file does not exist or is not a regular file, skipping Using Port : usb Using Programmer : avrisp2 Setting bit clk period : 19200.0 avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200109639 avrdude: stk500v2_recv_mk2: error in USB receive AVR Part : ATtiny2313 Chip Erase delay : 9000 us PAGEL : PD4 BS2 : PD6 RESET disposition : possible i/o RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 6 4 0 no 128 4 0 4000 4500 0xff 0xff flash 65 6 32 0 yes 2048 32 64 4500 4500 0xff 0xff signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00 Programmer Type : STK500V2 Description : Atmel AVR ISP mkII Programmer Model: AVRISP mkII Hardware Version: 1 Firmware Version Master : 1.10 Vtarget : 5.2 V SCK period : 19569.47 us avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 1.98s avrdude: Device signature = 0x1e910a avrdude: safemode: lfuse reads as 64 avrdude: safemode: hfuse reads as DF avrdude: safemode: efuse reads as FF avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: reading input file "tiny2313.hex" avrdude: writing flash (110 bytes): Writing | ################################################## | 100% 76.84s avrdude: 110 bytes of flash written avrdude: verifying flash memory against tiny2313.hex: avrdude: load data flash data from input file tiny2313.hex: avrdude: input file tiny2313.hex contains 110 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 72.90s avrdude: verifying ... avrdude: 110 bytes of flash verified avrdude: safemode: lfuse reads as 64 avrdude: safemode: hfuse reads as DF avrdude: safemode: efuse reads as FF avrdude: safemode: Fuses OK avrdude done. Thank you.
なんかむちゃくちゃ遅い。。。
http://www.mikrocontroller.net/topic/96528
-Bオプション外すと心持ち早くなった気がする。。?
書き込む前にavrdudeのターミナル(-tオプション)で
-BオプションかけてBaud rate設定しといて
書き込むのが今のところの最善策かな。
Baud rateが早いほうがいいか遅いほうがいいかはよくわからない。