Bootloaded ATMEGA328 won't work in Uno board

I have a working Uno clone board.

I bought a couple of bootloaded ATMEGA328P-PU chips (Optiboot) and tried them in my Uno board. When I tried to download a sketch to them the TX led blinked faintly, that's it, and I got the typical stk500 synchronisation message. Put the original chip back in and everything working fine.

I asked the Ebay vendor if the chips should work in an Uno board but they didn't answer that question, they only said to hook it up to a crystal, etc and a serial connection. Are there different versions of bootloaders, and some won't work in an Uno (clone) board.

My intention was to just pop the bootloaded AVRs into my Uno board, download the sketch to them then use the AVRs standalone in a circuit.

Is my thinking wrong.

Cheers,

Keith.

Your thinking is okay, but you need to write the (newest) bootloader yourself.

Use a programmer, for example USBasp or an Arduino as ISP.
Connect it to the ICSP header and use the Arduino IDE to burn the bootloader into it.
If you use the newest Arduino IDE (for example the stable version 1.0.5), it will also write the newest bootloader into it.

I think at max you are facing 2 problems here ,1) you bootloader isn't finely programmed into the uC.

  1. The fuses aren't correct!
    (I think this is most likely to be the problem)

beefy23:
Is my thinking wrong.

Nope.

Maybe the seller doesn't know what he's really selling and they have no bootloader...

Thanks very much guys.

I burned the bootloader myself using my Uno clone as an ISP and the ATMEGA328P on a breadboard with a crystal, etc. Everything went perfect.

Afterwards put the newly bootloaded AVR into my Uno board and I could program sketches into it.

I think from now on I'll just get the basic AVR chip if I can find it cheaper an bootload it myself. Regarding supply from China, I've heard a few stories on my Google hunting about "bootloaded" AVRs without a bootloader, and even Arduino boards where there was no bootloader on the AVR, although the latter issue hasn't got me yet.

Keith.

Well done.

A Arduino Pro Mini clone is sometimes cheaper and has already the electronics to make it run:

Caltoa:
Well done.

A Arduino Pro Mini clone is sometimes cheaper and has already the electronics to make it run:
arduino pro mini for sale | eBay

Yes I agree. The reason I'm doing it this way (as well as designing a PCB with a Nano) is for reliability. I'm prototyping a board design and heard stories of some Chinese clone boards packing up after a short time. I want to send a working prototype to someone for him to "check it out". It's a bit more chunky but it will be solid and reliable. Thought it would also be good to have some spare bootloaded AVRs for my Uno board.

In hindsight now I'm glad the chip bootloaders (if installed) didn't work, because now I know how to burn bootloaders myself. Funny thing is though, can't find AVR chips without bootloaders that are any cheaper than supposedly bootloaded AVRs.

Now I've got my confidence using my Uno board as an ISP, I'll have to buy one of the Pro Minis and build my circuit around one of them, they are even cuter than the Nanos.

Those very cheap clones use the cheapest components.
The most broken part is the crystal, but I think those Pro Mini use a ceramic resonater, which can withstand more mechanical shocks.
The second problem is the minimal solder that is used. I have to make repairs sometimes.
Also capacitors can break down very fast. The larger the capacitor, the faster it gets broken. Luckely the Pro Mini uses only small capacitors.
And the pcb copper traces are very thin, but I have not seen a problem with that.

For reliability, you should have protection against EMP or high voltage peaks at the inputs. The official Arduino boards don't have that.

ATmega328p chips without bootloader are cheaper if you buy 5 or 10 :stuck_out_tongue:

You have to be careful that they will send you the 'P' version ATmega328P. Without the 'P' it is no longer compatible with the Arduino Uno.

will the chip work on a borad with a 12MHz crystal or do I need only 8MHz or 16MHz crystals**?**

You could avoid this whole bootloader version, fuse selection, etc.
http://forum.arduino.cc/index.php?topic=182849.0
Windows example but AVRDYDE commands are same for any scripting OS.

Plus, you now have a set of Hex backup files.

Ray

Caltoa,

thanks very much for all that info. I definitely feel better making my "chunky" board now. Interesting you mentioned about surge protection because one issue I did have was the board going "haywire" when I switched off the power supply or turned my workshop fan off. After that, I bought a mains surge suppressor, plus on my board I added the following (in order, and wired in parallel) before the input to the 7805 voltage regulator:

Low voltage varistor
3300uF capacitor
Low voltage transient voltage suppressor
Another 3300uF capacitor

Then at the 5v output of the 7805 there's a 2200uF capacitor. I really don't know what I'm doing so I'm attempting to go overkill. My board is interfacing with my cnc plasma cutting profile table so I don't want it giving me any temperamental problems while my table is in the middle of a cut. I've also got some 3 amp toroid core 470 uH inductors and thought about putting them in the power supply lines to reduce rate of rise of current of voltage spikes, but like I say I didn't know if I'd be creating more problems than solving (like creating a resonant RC circuit). So I didn't include them. I still have to build and test my new surge protected board. It will definitely be a kick in the elephant skin sack if the surge protection doesn't work.

I might also look at using the internal oscillator and do away with the external one. No super high speed or timing needs with this circuit.

Onir,

I think (but am not sure) that the chip will still work with a 12 Mhz crystal but any timing related programming must be done for that frequency. I'd start a new thread with your question and get answers from members more knowledgeable then myself. I'm quite a beginner to the Aruduino.

Ray,

thanks for that link, I've saved it. Could come in handy.

Keith.

Did you use two 100nF capacitors next to the 7805 ?
If you don't have that, the 3300uF won't help a lot.
Normally about 22uF is enough, but 2200uF is okay with me.

Putting a few inductors in the power line can make it worse. I don't know which power lines you mean. You can buy a LC filter for the mains voltage.

Into the 7805 I've also got a 300nF (0.3uF) cap. and out of the 7805 there's a 100nF. For the input some diagrams show the 300nF and some show the 100nF. Nearly all of them show 100nF on the output though.

Sorry I wasn't very explicit when I said power lines. I was basically meaning the unregulated DC lines before the 7805. I was considering putting the inductors right at the beginning before the varistor, transient voltage suppressor and 3300uF caps. Yeah, probably safer to leave them out, my "design" would be nothing more than shooting in the dark.

Keith.

beefy23:
Then at the 5v output of the 7805 there's a 2200uF capacitor. I really don't know what I'm doing so I'm attempting to go overkill.

There is no need to put other than the 0.1µF capacitor at the output of the regulator - in fact it turns out to be a bad idea because if the input capacitor happens to be discharged suddenly, it will tend to draw current back through the regulator.

It is of course, possible to counter this by adding yet another component, a diode from the output to the input and this is detailed in the datasheets, but the point is - it is not necessary; it is the purpose of the regulator to regulate and if you design things correctly and have the 0.1µF bypass capacitor, it will do so perfectly reliably.

If you are looking for ways that impulses may enter the system, as long as the supply system is simply adequate, you need to look elsewhere for the problem. The crystal has been mentioned but the first thing to look at always is to ensure all grounds are as direct, stout and short as possible and return directly to the Arduino (as a "star" point), and then that input and output circuits contain no wide "loops" through which to inject interference to the chip.

Thanks very much Paul.

You just saved my life. I researched further, and the big cap on the output is often a killer of the 7805.

I am removing the 2200uF capacitor from the output, and having done more Googling after reading your information, changing my small caps from polyester ones to ceramic ones, which seems to be the recommended type for ESR reasons.

I'll also put a diode in circuit to protect against reverse polarity connection.

Keith