User Tools

Site Tools


tutorials:learn:avr:avrdude.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:learn:avr:avrdude.html [2010/10/20 16:01]
daigo created
tutorials:learn:avr:avrdude.html [2016/01/28 18:05] (current)
Line 35: Line 35:
  
  
-  * -p <​partno>:​ This is just to tell it what microcontroller its programming. For example, if you are programming an ATtiny2313, ​ use attiny2313 as the partnumber+  ​* **-p <​partno>​**: This is just to tell it what microcontroller its programming. For example, if you are programming an ATtiny2313, ​ use attiny2313 as the partnumber
   ***-b <​baudrate>​**:​ This is for overriding the serial baud rate for programmers like the STK500. Don't use this switch, the default is correct. ​   ***-b <​baudrate>​**:​ This is for overriding the serial baud rate for programmers like the STK500. Don't use this switch, the default is correct. ​
-  *-B <​bitrate>:​ This is for changing the bitrate, which is how fast the programmer talks to the chip. If your chip is being clocked very slowly you'll need to talk slowly to it to let it keep up. It'll be discussed later, for now don't use it.  +  ​***-B <​bitrate>​**: This is for changing the bitrate, which is how fast the programmer talks to the chip. If your chip is being clocked very slowly you'll need to talk slowly to it to let it keep up. It'll be discussed later, for now don't use it.  
-  *-C <​config-file>:​ The config file tells avrdude about all the different ways it can talk to the programmer. Theres a default configuration file, so lets just use that: don't use this command switch +  ​***-C <​config-file>​**: The config file tells avrdude about all the different ways it can talk to the programmer. Theres a default configuration file, so lets just use that: don't use this command switch 
-  * -c <​programmer>:​ Here is where we specify the programmer type, if you're using an STK500 use **stk500**, if you're using a DT006 programmer use **dt006**, etc.  +  ​* **-c <​programmer>​**: Here is where we specify the programmer type, if you're using an STK500 use **stk500**, if you're using a DT006 programmer use **dt006**, etc.  
-  * -D: This disables erasing the chip before programming. We don't want that so don't use this command switch. +  ​* **-D**: This disables erasing the chip before programming. We don't want that so don't use this command switch. 
-  *-P <​port>:​ This is the communication port to use to talk to the programmer. It might be COM1 for serial or LPT1 for parallel or USB for, well, USB.  +  ​***-P <​port>​**: This is the communication port to use to talk to the programmer. It might be COM1 for serial or LPT1 for parallel or USB for, well, USB.  
-  *-F: This overrides the signature check to make sure the chip you think you're programming is. The test is strongly recommended as it tests the connection, so don't use this switch. +  ​***-F**: This overrides the signature check to make sure the chip you think you're programming is. The test is strongly recommended as it tests the connection, so don't use this switch. 
-  * -e: This erases the chip, in general we don't use this because we auto-erase the flash before programming. +  ​* **-e**: This erases the chip, in general we don't use this because we auto-erase the flash before programming. 
-  *-U <​memtype>:​r|w|v:<​filename>​[:​format]:​ OK this one is the important command. Its the one that actually does the programming. The <​memtype>​ is either **flash** or **eeprom** (or **hfuse**, lfuse or **efuse** for the chip configuration fuses, but we aren't going to mess with those). the r|w|v means you can use r (read) w (write) or v (verify) as the command. The <​filename>​ is, well, the file that you want to write to or read from. and [:format] means theres an optional format flag. We will always be using "Intel Hex" format, so use i \\ So, for example. If you wanted to write the file test.hex to the flash memory, you would use -U flash:​w:​test.hex:​i. If you wanted to read the eeprom memory into the file "​eedump.hex"​ you would use -U eeprom:​r:​eedump.hex:​i +  ​***-U <​memtype>:​r|w|v:<​filename>​[:​format]**: OK this one is the important command. Its the one that actually does the programming. The **<​memtype>​** is either **flash** or **eeprom** (or **hfuse**, ​**lfuse** or **efuse** for the chip configuration fuses, but we aren't going to mess with those). the **r|w|v** means you can use **r** (read)** w** (write) or **v** (verify) as the command. The **<​filename>​** is, well, the file that you want to write to or read from. and **[:format]** means theres an optional format flag. We will always be using "Intel Hex" format, so use **i** \\ So, for example. If you wanted to write the file **test.hex** to the flash memory, you would use **-U flash:​w:​test.hex:​i**. If you wanted to read the eeprom memory into the file "​eedump.hex"​ you would use **-U eeprom:​r:​eedump.hex:​i** 
-  *-n: This means you don't actually write anything, its good if you want to make sure you don't send any other commands that could damage the chip, sort of a '​safety lock'​. +  ​***-n**: This means you don't actually write anything, its good if you want to make sure you don't send any other commands that could damage the chip, sort of a '​safety lock'​. 
-  * -V: This turns off the auto-verify when writing. We want to verify when we write to flash so don't use this.  +  ​* **-V**: This turns off the auto-verify when writing. We want to verify when we write to flash so don't use this.  
-  *-u: If you want to modify the [[http://​www.ladyada.net/​learn/​avr/​fuses.html|fuse bits]], use this switch to tell it you really mean it.  +  ​***-u**: If you want to modify the [[http://​www.ladyada.net/​learn/​avr/​fuses.html|fuse bits]], use this switch to tell it you really mean it.  
-  *-t: This is a '​terminal'​ mode where you can type out commands in a row. Don't use this, it is confusing to beginners.  +  ​***-t**: This is a '​terminal'​ mode where you can type out commands in a row. Don't use this, it is confusing to beginners.  
-  * -E: This lists some programmer specifications,​ don't use it.  +  ​* **-E**: This lists some programmer specifications,​ don't use it.  
-  *-v: This gives you '​verbose'​ output...in case you want to debug something. If you want you can use it, but in general we won'​t. +  ​***-v**: This gives you '​verbose'​ output...in case you want to debug something. If you want you can use it, but in general we won'​t. 
-  *-q: This is the opposite of the above, makes less output. In general we won't use it but maybe after a while you wold like to.+  ​***-q**: This is the opposite of the above, makes less output. In general we won't use it but maybe after a while you wold like to.
  
 The ones you'll use 99% of the time are highlighted in red. Let's review them in more detail The ones you'll use 99% of the time are highlighted in red. Let's review them in more detail
Line 73: Line 73:
 Look up the name of the programmer you're using, and commit it to heart! ​ Look up the name of the programmer you're using, and commit it to heart! ​
  
--p <​partno> ​+==== -p <​partno> ​==== 
  
  
Line 150: Line 150:
   *To verify a file called **mydata.eep** from the eeprom use the command **-U eeprom:​v:​mydata.eep**   *To verify a file called **mydata.eep** from the eeprom use the command **-U eeprom:​v:​mydata.eep**
   *To read the low fuse into a file use the command **-U lfuse:​r:​lfusefile.hex:​i** ​   *To read the low fuse into a file use the command **-U lfuse:​r:​lfusefile.hex:​i** ​
 +
 ==== Pulling it together ​ ==== ==== Pulling it together ​ ====
  
/home/ladyada/public_html/wiki/data/attic/tutorials/learn/avr/avrdude.html.1287590506.txt.gz · Last modified: 2016/01/28 18:05 (external edit)