AVRのワンチップマイコンにはfuse bit(ヒューズビット)というものがあり、これによってチップの動作を設定することができます。fuse bitには各ビットごとに意味があり、その意味はチップの型番によって異なるので注意が必要です。
ATmega328Pチップの、各fuse bitの意味です。
(画像上部のNote:にも有りますが,チェックが入っていない時がON”=1″なので注意!!)
http://www.engbedded.com/fusecalc より
各fuse bitの初期値は以下の通りです。
Low : 0x62 High: 0xD9 Ext : 0xFF |
avrdude.exeを使ってfuse bitを変更することができます。avrdude.exeは、ArduinoのIDEをダウンロードすると、zip内のhardware\tools\avr\binフォルダに入ってます。
avrdude.exe -C ..\etc\avrdude.conf -c arduino -p m328p -t -B 4800 -P COM7 hfuse:w:0b11011001:m -U lfuse:w:0b01100010:m |
“-P COM7″のところは、COMポートを指定します。
各オプションの意味は、引数無しでexeを実行すると分かります。
Usage: avrdude [options]
Options:
-p <partno> Required. Specify AVR device.
-b <baudrate> Override RS-232 baud rate.
-B <bitclock> Specify JTAG/STK500v2 bit clock period (us).
-C <config-file> Specify location of configuration file.
-c <programmer> Specify programmer type.
-D Disable auto erase for flash memory
-i <delay> ISP Clock Delay [in microseconds]
-P <port> Specify connection port.
-F Override invalid signature check.
-e Perform a chip erase.
-O Perform RC oscillator calibration (see AVR053).
-U <memtype>:r|w|v:<filename>[:format]
Memory operation specification.
Multiple -U options are allowed, each request
is performed in the order specified.
-n Do not write anything to the device.
-V Do not verify.
-u Disable safemode, default when running from a script.
-s Silent safemode operation, will not ask you if
fuses should be changed back.
-t Enter terminal mode.
-E <exitspec>[,<exitspec>] List programmer exit specifications.
-y Count # erase cycles in EEPROM.
-Y <number> Initialize erase cycle # in EEPROM.
-v Verbose output. -v -v for more.
-q Quell progress output. -q -q for less.
-? Display this usage. |
関連記事
コメントを残す