Avrdude: -c Here you specify the type of flash programmer that you’re using. Many serial programmers, in- cluding the ArduinoISP, use the generic av risp type (not the arduino type, which pro- grams the Arduino itself ). There are also config- urations for both usbasp and usbtiny pro- grammers. If you’d like to see the full list, type avrdude -c ?. -p Here you specify the type of AVR chip that you’re programming for. In our case “m168” is an AT- mega168 chip or “m168p” if you’ve got that version. same: avrdude -p ? -P If you’re not using a native USB programmer (for instance, if you’re using an ArduinoISP), you’ll need to know which serial port the programmer is connected to. See “Common AVRDUDE Con- figurations” on page 38 for details. On Windows, it’s usually something like COM3; on Linux and Mac OS, it’s in the /dev/tty* lineup. -b This sets the baud rate if you’re using a serial programmer. You’ll have to know what speed your programmer wants, or use trial and error. -n Write-nothing mode. This one lets you test out commands without worrying that you’ll acci- dently mess up the chip. -t Terminal mode. This mode lets you talk to the AVR chip directly. After the programmer has connected, type sig to read the AVR’s device signature, which makes a quick test of basic communication between the programmer and chip. Type help to see all the options. -C This lets you use a nonstandard configuration file. If the version of AVRDUDE that you’ve got doesn’t support a particular chip or program- mer, you can often fix it by getting a more recent configuration file. I’ve included mine in the book’s software bundle. -U This the command that reads or writes to memory. You’ll almost always be calling this from a makefile, but if you’d like to dump the memory of an AVR chip to a file, or flash in a .hex file that someone has already compiled for you, this is how you’d do it. In our case: avrdude -p t44 -P usb -c usbtiny Avrdude errors: => avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check. This response from avrdude means that it can talk to the programmer but the programmer can't talk to the chip. Troubleshoot: https://learn.adafruit.com/usbtinyisp/help don’t have power to the chip, when any of the RESET, MISO, MOSI, or SCK lines aren’t connected properly, or even if you’ve got something else plugged into any of these pins that’s inter- fering with your setup. => avrdude: Device signature = 0x1e9406 avrdude: Expected signature for ATmega168P is 1E 94 0B Double check chip, or use -F to override this check. 1) AVR chip type wrong; if type not available, use a custom config file with -C 2) 0xffffff or 0x000000 retrieved: connection wrong => 1) avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you. 2) avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp' 3) avrdude: Error: Could not find USBtiny device (0x1781/0xc9f) Cannot find programmer PUT THIS ALL IN MAKEFILE MCU This is the type of AVR chip you’re using. For a complete list of supported chips, type avr-gcc -- target-help and about halfway down you’ll find a list of “Known MCU names.” F_CPU This definition tells the compiler what clock speed your chip is running at. If you don’t have an external clock source, like a crystal, this is either 1,000,000 or 8,000,000 for the ATmega chips—one megahertz or eight megahertz. Getting this right will matter for the timing of serial communication, and anything else where timing is key. BAUD This is the baud rate that you’re going to use for computer-to-AVR serial communications, and 9,600 baud is a good conservative default. MAIN This entry is just the name of the program that you’re compiling and flashing —the code that contains the main() routine. LOCAL_SOURCE Here you have the chance to list any other .c files that your main code section needs to run. EXTRA_SOURCE_DIR and EXTRA_SOURCE_FILES This is an option to include code that lives in another directory or folder somewhere on your system. PROGRAMMER_TYPE The two “programmer” options are for AVRDUDE, along with information about what chip we’re programming from MCU. Here, you enter the type of flash programmer that you’re using, and the makefile passes it to AVRDUDE using the -c option. If you’re using a USBTiny or USBasp, for instance, you enter that here. If you’re using the Arduino as a flash programmer, enter avrisp. PROGRAMMER_ARGS The other “programmer” option is for any of the other necessary AVRDUDE options. If you’re using a USBTiny or USBasp, you won’t have to enter anything here; just leave the line blank. If you are using a serial-based programmer, you’ll need to specify the serial port and baud rate using the -P and -b options, respectively.