2010年12月8日水曜日

Arduino のoptibootについて。

tiny84の結果が気になりUNOがシリアル変換機にされてたのも有り、UNOに328を刺して、手動と、AVRfuseの結果を考える。

手動の結果

avrdude  -p m328p -c stk500 -b115200 -P /dev/cu.usbmodem5d21 -UTiny13ArduinoAutorestart.hex -v


avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/


         System wide configuration file is "/usr/local/etc/avrdude.conf"
         User configuration file is "/Users/comori/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping


         Using Port            : /dev/cu.usbmodem5d21
         Using Programmer      : stk500
         Overriding Baud Rate  : 115200
avrdude: successfully opened stk500v1 device -- please use -c stk500v1
         AVR Part              : ATMEGA328P
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         RESET disposition     : dedicated
         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     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00


         Programmer Type : STK500
         Description     : Atmel STK500
         Hardware Version: 3
         Firmware Version: 3.3
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us


avrdude: AVR device initialized and ready to accept instructions


Reading | ################################################## | 100% 0.00s


avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
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 "Tiny13ArduinoAutorestart.hex"
avrdude: input file Tiny13ArduinoAutorestart.hex auto detected as Intel Hex
avrdude: writing flash (50 bytes):


Writing | ################################################## | 100% 0.02s


avrdude: 50 bytes of flash written
avrdude: verifying flash memory against Tiny13ArduinoAutorestart.hex:
avrdude: load data flash data from input file Tiny13ArduinoAutorestart.hex:
avrdude: input file Tiny13ArduinoAutorestart.hex auto detected as Intel Hex
avrdude: input file Tiny13ArduinoAutorestart.hex contains 50 bytes
avrdude: reading on-chip flash data:


Reading | ################################################## | 100% 0.01s


avrdude: verifying ...
avrdude: 50 bytes of flash verified


avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK


avrdude done.  Thank you.

でたらめなHEXを送ってるのは愛嬌で我慢して欲しい。
送れてるらしく前に入ってたLチカが止まった。

AVRFUSEはこりゃ違うって言う感じだ

これがtiny84
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATtiny84 is 1E 93 0C
avrdude: reading input file "/Users/comori/Tiny13ArduinoAutorestart.hex"
avrdude: input file /Users/comori/Tiny13ArduinoAutorestart.hex auto detected as Intel Hex
avrdude: writing flash (50 bytes):
avrdude: stk500_recv(): programmer is not responding

こっちが328P
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: erasing chip
avrdude: reading input file "/Users/comori/Tiny13ArduinoAutorestart.hex"
avrdude: input file /Users/comori/Tiny13ArduinoAutorestart.hex auto detected as Intel Hex
avrdude: writing flash (50 bytes):
avrdude: 50 bytes of flash written
avrdude: verifying flash memory against /Users/comori/Tiny13ArduinoAutorestart.hex:
avrdude: load data flash data from input file /Users/comori/Tiny13ArduinoAutorestart.hex:
avrdude: input file /Users/comori/Tiny13ArduinoAutorestart.hex auto detected as Intel Hex
avrdude: input file /Users/comori/Tiny13ArduinoAutorestart.hex contains 50 bytes
avrdude: reading on-chip flash data:
avrdude: verifying ...
avrdude: 50 bytes of flash verified

avrdude done.  Thank you.



この差がArduinoに書けるかどうかみたいな差みたいだ。


実はoptibootのバージョンが違う。

tiny84で試したのは、v3よりまだ新しい物をgoogle codeからダウンロードして、ビルドしなおした物だ。コンテンツの日付で見ると最新になってる。パッケージになってない物だ。

これでも、tiny84は開発中扱い・・何故か、makeallでhexをはき出すが・・使えないってのはこれいかに。

Avrdudeの方のオプションを変えると行けるのかも知れない。

クロック8MHz 19200BPSでもう一度作って、今度は、FDTIで繋いだ結果がこれです。
avrdude  -p t84 -c stk500 -b19200 -P /dev/tty.usbserial-A6008Snk -UTiny13ArduinoAutorestart.hex -F
avrdude: successfully opened stk500v1 device -- please use -c stk500v1

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e930c
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: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: reading input file "Tiny13ArduinoAutorestart.hex"
avrdude: input file Tiny13ArduinoAutorestart.hex auto detected as Intel Hex
avrdude: writing flash (50 bytes):

Writing |                                                    | 0% 0.00savrdude: stk500_recv(): programmer is not responding



0 件のコメント:

コメントを投稿