Can I upload firmware of atmega16u2 of arduino board using arduino as ISP ?
The only real requirement (other than it being an AVR) is that the Arduino IDE can compile the code first. There are things like the chip, speed, etc., that are determined using the boards.txt file. If there is no entry the Arduino IDE can not compile the code. By default the Arduino IDE does not have an ATMega16u2 entry, so you will need to add it. Otherwise the IDE should be able to compile the code and send the correct commands to avrdude.
If you are uploading with an the Pocket AVR programmer using the command line, make sure that you are in the directory that the hex file is located in. From there, avrdude will know where to look to flash the code to your microcontroller. For example, I have the redboard.hex file complete with an Arduino Uno bootloader that I want to flash on my RedBoard with Atmega328P. If the fuse bits are set, you would write it like so to flash the firmware and lock the fuse bits :
avrdude -b 19200 -c usbtiny -p m328P -v -e -U flash:w:redboard.hex -U lock:w:0x0F:m
For some strange reason you will lock it as 0x0F but when checking with an Atmel AVR microcontroller, it looks to be 0xCF for the lock bits.
If you are getting an error in the Arduino IDE similar to this with the Pocket AVR Programmer:
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0x00
avrdude: verification error; content mismatch
Try looking at this tutorial => http://www.xuan-wu.com/2012-11-19-Arudino-Uno-Bootloader.
I never fully understood this particular Arduino error output. I think it has something to do with either the fuse bits or lock bits when the programmer is trying to verify the bits in Arduino’s board definitions. It could also be the write speed to the microcontroller’s flash memory or something with the RESET pin being triggered when your computer is trying to open the COM port to the Arduino development board as explained in the tutorial.
I made a short tutorial on how to burn the Bootloader by using the AVR MKII ISP, so if anyone is going that route, take a look: http://www.youtube.com/watch?v=EsLOMdu50YU&feature=youtu.be
If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!
Forgot your password?
No account? Register one!