Go Down

Topic: 328P-PU and 168PA-PU bootloader problems (Read 3901 times) previous topic - next topic



I have been using arduino for some time and had an "arduino on a breadboard" running for quite some time. At the time I was using the IC's from both Atmel AND with a burnt bootloader. I never got to burn the bootloaders nicely. Now I am in the process of using the arduino "once" more.

I have 2 or 3 328P-PU's and 2 168PA-PU's wich might have a (faulty) bootloader on them or not.

Now the question, like I asked last year;

Is there a proper way of erasing/reflashing the bootloader? I have obviously tried the manual/tutorial on burning a bootloader but there are so many tips/guides/tutorials and opinions that I have tried, maybe a super-arduino-guy can help me out.

Lets start with this;
Please make me understand the difference in chips and what that means in terms of bootloaders? (non-P,P PA etc)
If a bootloader has been burnt before (non-arduino, 8mhz,16mhz,etc), how to "reset" it and burn the arduino bootloader?
If I get an error from AVR dude, how can I check a log and implement that?

I am looking for some proper answers, since last year I stranded in the exact same sport. Is there someone who can help me with (one of) my questions?


The Arduino bootloader burning process takes care of erasing the chip and setting the fuses.

If the chip fuses have been set to require an external crystal or resonator you will need to provide the crystal or an external clock.

If the chip fuses have been set to disable either the serial programming or the Reset features you will need a High Voltage Parallel Programmer (like the High Voltage Rescue Shield) to reset the chip to factory settings.

What ISP device are you using to program bootloaders?
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


Sep 27, 2012, 06:37 pm Last Edit: Sep 27, 2012, 08:22 pm by SuperR Reason: 1
Forgot to mention, the only ISP I have available is the Arduino ISP sketch. If there would be an usb ISP available for a reasonable/low price by which the process would perform easier or better, I would like to hear about that. If the Arduino ISP sketch, with some know-how is suitable, that would be great of course.

For instance, would it be easier to use something like this or would I have the same issues?

This topic shows both good and bad news concidering the possibly bad flashed uC's;


Yes, the USBtinyISP is another fine choice.  Don't forget to buy a 6-pin cable to connect it to your board.

The "only works once" problem is usually that the Auto Reset isn't working.  With a fresh bootloader the chip has nothing better to do on startup than wait for an upload.  Once a sketch has been uploaded there is only a brief window after Reset to initiate an upload.  If Auto Reset isn't working you will have to do a manual reset to do an upload.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp




Both links show ways of uploading bootloaders or any files to your breadboard Arduino. Uploading the bootloader starts with a chip erase, so all other program memory is cleared.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics


September 30, 2012


This section of the forum is generalized enough, I hope, such that I can post my question here.  I own an avrisp mkii programmer (built by atmel I think), and multiple arduino boards.  I have plugged the avrisp mkii into one serial port on my laptop here, and am using a second arduino board strictly as a power source.

I pass power from the 'not to be programmed' arduino over to the 'to be programmed' one (plus 5 volts), I fire up the arduino IDE, and try to progam the awainting board from inside the Arduino IDE.  ?????  I'm obviously not getting all of the steps done here, because it's giving me trouble.  I don't even get any notification of any kind that there is a commencement of programming, or anything like that.  ?????

There's 950 bezillion sources out there on how to go about this, but it just isn't very clear what everyone is saying.  I don't even need the second arduino (the 'not to be programmed' one).  I could just use a 7805 in it's place.  I know that one of the ways to program the target arduino is to place a second arduino into the mix, but I'm not pursueing this option here just now.  Using the 'second arduino into the mix' option strikes me as something that I would like to master as well, but I just want to nail the 'w/ avrisp mkii' process first.  I can't figure out what I'm missing here.  Seems like it should be simple enough,   ???????   Can anyone offer some help???


Yesterday my TinyUSBISP arrived. Fairly quick for HongKong standards. I was ofcourse excited to try it out so I went to Arduino GUI and tried to burn the bootloader. "Error, bad signature". Ok fine, so I went out to look for the correct signature for my 168PA-PU. 1E 94 0B if I remember correctly. After altering some files I managed to get the bootloader on. Or at least, it gave no errors.

However, now I cannot get anything on the 168PA-PU. I tried connecting the arduino board and using that as a programmer and I have used the ISP header and the USBTinyISP as a programmer.

"Not in sync"

So here I am, back to 0. I have altered drivers, conf files etc. I might try it on another pc. So assume I have e freshly installed windows and that I have just downloaded the Arduino installation zip. What should I do?

Is the bootloader badly burnt since I "tricked" avrdude by changing the signature and nothing more?


After altering some files I managed to get the bootloader on.

What files did you alter? It generally is not a good idea to "trick" the programmer. It might upload code designed to work at a different address space.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics


I think I modified "ATmegaBOOT_168" in which I changed a 06 to a 0B.

However, assume I have a fresh Windows install and nothing altered. Only that way I might reproduce a good result. Will it be smart to just use avrdude since I need to input more? Maybe that gives mroe insight compared to the Arduino GUI.


Today I got some extra Atmega168A-PU's. I already had some PA-PU's. I know the signature of the regular 168 devices are different and I knew that I had to change "something" on order to get the bootloader up and running. The funny thing is that I might have gotten it to work some time ago. The bootloader said to be burnt when altering the board.txt file so it would load the m168p file instead of the non-p. However, I was fully sure that the USBTinyISP could put programs on the IC's  from within the Arduino Environment. However, when I disconnected the USBTinyISP, connected the Arduino board and selected the corresponding com-port, all worked well!
So, I fixed the problem, which wasn't there after all.
As for the 328P devices, the Uno uses those too so when I selected that board, all worked too.

Go Up