⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 avrdude.texi

📁 这是一个非常有价值的参考代码
💻 TEXI
📖 第 1 页 / 共 4 页
字号:
@item vtarg @var{voltage}Set the target's supply voltage to @var{voltage} Volts.@item varef @var{voltage}Set the adjustable voltage source to @var{voltage} Volts.This voltage is normally used to drive the target's@emph{Aref} input on the STK500.@item fosc @var{freq}[@var{M}|@var{k}]Set the master oscillator to @var{freq} Hz.An optional trailing letter @var{M}multiplies by 1E6, a trailing letter @var{k} by 1E3.@item fosc offTurn the master oscillator off.@item sck @var{period}@emph{STK500 only:}Set the SCK clock period to @var{period} microseconds.@emph{JTAG ICE only:}Set the JTAG ICE bit clock period to @var{period} microseconds.Note that unlike STK500 settings, this setting will be reverted toits default value (approximately 1 microsecond) when the programmingsoftware signs off from the JTAG ICE.@item parms@emph{STK500 only:}Display the current voltage and master oscillator parameters.@emph{JTAG ICE only:}Display the current target supply voltage and JTAG bit clock rate/period.@end table@c@c Node@c@node Terminal Mode Examples,  , Terminal Mode Commands, Terminal Mode Operation@section Terminal Mode Examples@noindentDisplay part parameters, modify eeprom cells, perform a chip erase:@example@cartouche% avrdude -p m128 -c stk500 -tavrdude: AVR device initialized and ready to accept instructionsavrdude: Device signature = 0x1e9702avrdude: current erase-rewrite cycle count is 52 (if being tracked)avrdude> part>>> part AVR Part              : ATMEGA128Chip Erase delay      : 9000 usPAGEL                 : PD7BS2                   : PA0RESET disposition     : dedicatedRETRY pulse           : SCKserial program mode   : yesparallel program mode : yesMemory Detail         :                            Page                       Polled  Memory Type Paged  Size   Size #Pages MinW  MaxW   ReadBack  ----------- ------ ------ ---- ------ ----- ----- ---------  eeprom      no       4096    8     0  9000  9000 0xff 0xff  flash       yes    131072  256   512  4500  9000 0xff 0x00  lfuse       no          1    0     0     0     0 0x00 0x00  hfuse       no          1    0     0     0     0 0x00 0x00  efuse       no          1    0     0     0     0 0x00 0x00  lock        no          1    0     0     0     0 0x00 0x00  calibration no          1    0     0     0     0 0x00 0x00  signature   no          3    0     0     0     0 0x00 0x00avrdude> dump eeprom 0 16>>> dump eeprom 0 16 0000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|avrdude> write eeprom 0 1 2 3 4>>> write eeprom 0 1 2 3 4 avrdude> dump eeprom 0 16>>> dump eeprom 0 16 0000  01 02 03 04 ff ff ff ff  ff ff ff ff ff ff ff ff  |................|avrdude> erase>>> erase avrdude: erasing chipavrdude> dump eeprom 0 16>>> dump eeprom 0 16 0000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|avrdude> @end cartouche@end example@noindentProgram the fuse bits of an ATmega128 (disable M103 compatibility,enable high speed external crystal, enable brown-out detection, slowlyrising power).  Note since we are working with fuse bits the -u (unsafe)option is specified, which allows you to modify the fuse bits. First display the factory defaults, then reprogram:@example@cartouche% avrdude -p m128 -u -c stk500 -tavrdude: AVR device initialized and ready to accept instructionsavrdude: Device signature = 0x1e9702avrdude: current erase-rewrite cycle count is 52 (if being tracked)avrdude> d efuse>>> d efuse 0000  fd                                                |.               |avrdude> d hfuse>>> d hfuse 0000  99                                                |.               |avrdude> d lfuse>>> d lfuse 0000  e1                                                |.               |avrdude> w efuse 0 0xff>>> w efuse 0 0xff avrdude> w hfuse 0 0x89>>> w hfuse 0 0x89 avrdude> w lfuse 0 0x2f>>> w lfuse 0 0x2f avrdude> @end cartouche@end example@c@c Node@c@node Configuration File, Platform Dependent Information, Terminal Mode Operation, Top@chapter Configuration File@noindentAVRDUDE reads a configuration file upon startup which describes all ofthe parts and programmers that it knows about.  The advantage of this isthat if you have a chip that is not currently supported by AVRDUDE, youcan add it to the configuration file without waiting for a new releaseof AVRDUDE.  Likewise, if you have a parallel port programmer that isnot supported by AVRDUDE, chances are good that you can copy andexisting programmer definition, and with only a few changes, make yourprogrammer work with AVRDUDE.AVRDUDE first looks for a system wide configuration file in a platformdependent location.  On Unix, this is usually@code{/usr/local/etc/avrdude.conf}, while on Windows it is usally in thesame location as the executable file.  The name of this file can bechanged using the @option{-C} command line option.  After the system wideconfiguration file is parsed, AVRDUDE looks for a per-user configurationfile to augment or override the system wide defaults.  On Unix, theper-user file is @code{.avrduderc} within the user's home directory.  OnWindows, this file is the @code{avrdude.rc} file located in the samedirectory as the executable.@menu* AVRDUDE Defaults::            * Programmer Definitions::      * Part Definitions::            * Other Notes::                 @end menu@c@c Node@c@node AVRDUDE Defaults, Programmer Definitions, Configuration File, Configuration File@section AVRDUDE Defaults@table @code@item default_parallel = "@var{default-parallel-device}";Assign the default parallel port device.  Can be overidden using the@option{-P} option.@item default_serial = "@var{default-serial-device}";Assign the default serial port device.  Can be overidden using the@option{-P} option.@item default_programmer = "@var{default-programmer-id}";Assign the default programmer id.  Can be overidden using the @option{-c}option.@end table@c@c Node@c@node Programmer Definitions, Part Definitions, AVRDUDE Defaults, Configuration File@section Programmer Definitions@noindentThe format of the programmer definition is as follows:@exampleprogrammer    id     = <id1> [, <id2> [, <id3>] ...] ;  # <idN> are quoted strings    desc     = <description> ;                  # quoted string    type     = par | stk500 ;                   # programmer type    baudrate = <num> ;                          # baudrate for serial ports    vcc      = <num1> [, <num2> ... ] ;         # pin number(s)    reset    = <num> ;                          # pin number    sck      = <num> ;                          # pin number    mosi     = <num> ;                          # pin number    miso     = <num> ;                          # pin number    errled   = <num> ;                          # pin number    rdyled   = <num> ;                          # pin number    pgmled   = <num> ;                          # pin number    vfyled   = <num> ;                          # pin number  ;@end example@c@c Node@c@node Part Definitions, Other Notes, Programmer Definitions, Configuration File@section Part Definitions@examplepart    id               = <id> ;                 # quoted string    desc             = <description> ;        # quoted string    devicecode       = <num> ;                # numeric    chip_erase_delay = <num> ;                # micro-seconds    pagel            = <num> ;                # pin name in hex, i.e., 0xD7    bs2              = <num> ;                # pin name in hex, i.e., 0xA0    reset            = dedicated | io;    retry_pulse      = reset | sck;    pgm_enable       = <instruction format> ;    chip_erase       = <instruction format> ;    memory <memtype>        paged           = <yes/no> ;          # yes / no        size            = <num> ;             # bytes        page_size       = <num> ;             # bytes        num_pages       = <num> ;             # numeric        min_write_delay = <num> ;             # micro-seconds        max_write_delay = <num> ;             # micro-seconds        readback_p1     = <num> ;             # byte value        readback_p2     = <num> ;             # byte value        pwroff_after_write = <yes/no> ;       # yes / no        read            = <instruction format> ;        write           = <instruction format> ;        read_lo         = <instruction format> ;        read_hi         = <instruction format> ;        write_lo        = <instruction format> ;        write_hi        = <instruction format> ;        loadpage_lo     = <instruction format> ;        loadpage_hi     = <instruction format> ;        writepage       = <instruction format> ;      ;  ;@end example@menu* Instruction Format::@end menu@c@c Node@c@node Instruction Format,  , Part Definitions, Part Definitions@subsection Instruction Format@noindentInstruction formats are specified as a comma seperated list of stringvalues containing information (bit specifiers) about each of the 32 bitsof the instruction.  Bit specifiers may be one of the following formats:@table @code@item 1The bit is always set on input as well as output@item 0the bit is always clear on input as well as output@item xthe bit is ignored on input and output@item athe bit is an address bit, the bit-number matches this bit specifier'sposition within the current instruction byte@item a@var{N}the bit is the @var{N}th address bit, bit-number = N, i.e., @code{a12}is address bit 12 on input, @code{a0} is address bit 0.@item ithe bit is an input data bit@item othe bit is an output data bit@end tableEach instruction must be composed of 32 bit specifiers.  The instructionspecification closely follows the instruction data provided in Atmel'sdata sheets for their parts.  For example, the EEPROM read and writeinstruction for an AT90S2313 AVR part could be encoded as:@exampleread  = "1  0  1  0   0  0  0  0   x x x x  x x x x",        "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";write = "1  1  0  0   0  0  0  0   x x x x  x x x x",        "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";@end example@c@c Node@c@node Other Notes,  , Part Definitions, Configuration File@section Other Notes@itemize @bullet@itemThe @code{devicecode} parameter is the device code used by the STK500and is obtained from the software section (@code{avr061.zip}) ofAtmel's AVR061 application note available from@url{http://www.atmel.com/atmel/acrobat/doc2525.pdf}.@itemNot all memory types will implement all instructions.@itemAVR Fuse bits and Lock bits are implemented as a type of memory.@itemExample memory types are: @code{flash}, @code{eeprom}, @code{fuse},@code{lfuse} (low fuse), @code{hfuse} (high fuse), @code{efuse}(extended fuse), @code{signature}, @code{calibration}, @code{lock}.@itemThe memory type specified on the AVRDUDE command line must match one ofthe memory types defined for the specified chip.@itemThe @code{pwroff_after_write} flag causes AVRDUDE to attempt to powerthe device off and back on after an unsuccessful write to the affectedmemory area if VCC programmer pins are defined.  If VCC pins are notdefined for the programmer, a message indicating that the device needs apower-cycle is printed out.  This flag was added to work around aproblem with the at90s4433/2333's; see the at90s4433 errata at:         @url{http://www.atmel.com/atmel/acrobat/doc1280.pdf}@itemThe boot loader from application note AVR109 (and thus also the AVRButterfly) does not support writing of fuse bits.  Writing lock bitsis supported, but is restricted to the boot lock bits (BLBxx).  Theseare restrictions imposed by the underlying SPM instruction that is usedto program the device from inside the boot loader.  Note that programmingthe boot lock bits can result in a ``shoot-into-your-foot'' scenario asthe only way to unprogram these bits is a chip erase, which will alsoerase the boot loader code.The boot loader implements the ``chip erase'' function by erasing theflash pages of the application section.Reading fuse and lock bits is fully supported.Note that due to the unability to write the fuse bits, the safemodefunctionality does not make sense for these boot loaders.@end itemize@c@c Node@c@node Platform Dependent Information, Troubleshooting, Configuration File, Top@appendix Platform Dependent Information@menu* Unix::* Windows::@end menu@c@c Node@c@node Unix, Windows, Platform Dependent Information, Platform Dependent Information@section Unix@menu* Unix Installation::           * Unix Configuration Files::    * Unix Port Names::             * Unix Documentation::          @end menu@c@c Node@c@node Unix Installation, Unix Configuration Files, Unix, Unix@subsection Unix Installation@noindentTo build and install from the source tarball on Unix like systems:@example$ gunzip -c avrdude-@value{VERSION}.tar.gz | tar xf -$ cd avrdude-@value{VERSION}$ ./configure$ make$ su root -c 'make install'@end exampleThe default location of the install is into @code{/usr/local} so youwill need to be sure that @code{/usr/local/bin} is in your @code{PATH}environment variable.If you do not have root access to your system, you can do the thefollowing instead:@example$ gunzip -c avrdude-@value{VERSION}.tar.gz | tar xf -$ cd avrdude-@value{VERSION}$ ./configure --prefix=$HOME/local$ make$ make install@end example@menu* FreeBSD Installation::        * Linux Installation::          @end menu@c@c Node@c@node FreeBSD Installation, Linux Installation, Unix Installation, Unix Installation@subsubsection FreeBSD Installation@noindentAVRDUDE is installed via the FreeBSD Ports Tree as follows:@example% su - root# cd /usr/ports/devel/avrdude# make install

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -