Atmega 328-PU breadboard programming problems

Hi,

I've been following this guide to try and program an Atmega328-PU on a breadboard :- http://arduino.cc/en/Tutorial/ArduinoToBreadboard however I'm having no luck at all and just end up programming the arduino board being used as the ISP instead of the chip on the breadboard.

I'm trying to use the method for running the Atmega328-PU with it's own internal clock but as I say, I seem to end up burning and uploading everything to the arduino ISP board instead of the chip on the breadboard.
I spent ALL day yesterday going from one tutorial to another until 3am and still I can't communicate with this chip effectively LOL
All the tutorials on this subject more or less say the same thing so it must be something I'm doing.

I know I need to change the signature in the AVRconf file when bootloading the Atmega328-PU from x0F to x14 which I did but I still get errors and I'm pretty sure it's burning the loader to my arduino board and not the chip.

I've even tried to bootload and upload a sketch using an Arduino to ISP shield I bought but I'm not getting on with that either.

Man, my head's in a spin....

If you look at both the wiring diagrams for setting up the 328-PU in that tutoral at the bottom of the page here:- http://arduino.cc/en/Tutorial/ArduinoToBreadboard
I've tried them both and once I've uploaded the ISP to the arduino board and then try to talk to the other chip, I just get sync errors.

The only step I cannot do in that tutorial is remove the chip from the ISP board so I'm wondering if it's that.. But then I read in another thread that it will just program both chips the same.. :confused:

HELP!!!!

MikeyBot:
Man, my head's in a spin....

Why?.. Did you applied for the superhuman on Discovery? :grin:

Okay.. have you searched the Arduino forum for bootloading the ATMEGA328 without using external xtal??

Khalid:

MikeyBot:
Man, my head’s in a spin…

Why?.. Did you applied for the superhuman on Discovery? :grin:

Okay… have you searched the Arduino forum for bootloading the ATMEGA328 without using external xtal??

LOL HI!

I’ve mostly been searching Google and that tutorial I linked to was about the most detailed I could find.

Right, I THINK I’ve got the bootloader on the Atmega328-PU now…
I followed the Burning the Bootloader section with a 16MHz crystal and two ceramic caps. That seemed to go fine. All TX, RX and no errors so I assume it has bootloaded the PU chip.

I have a LED connected to PIN 13 of the PU chip on the breadboard and when I remove all but the power jumpers the red LED still blinks which I take to mean it’s running on it’s own clock now and not the crystal.

The next thing I’m having issues with is uploading sketches which that tutorial recommends removing the chip from the Arduino board to do :confused:
Not really gonna happen with my arduino board cos it’s all SMD.

Gonna try uploading some sketches now I think the bootloader is in and running… I shall return!!!

hi..

you mention 328P 'variants? are you sure have the correct chips? and the correct settings for those chips?

What version of IDE are you using?.. have you tried going back to IDE v.23?

What UNO do you have? SMD version? or the DIP version? (I thought I had read UNO's cant flash bootloaders.. but I think I also read that can be ignored too..lol.. and does in fact work)

** Did you get the 'breadboard .zip' linked to at the bottom of the page?

Extract the content?

and put it in a folder called 'hardware' inside you sketches directory?

So you pick your board
set your port
upload Arduino ISP sketch

..........connect your target board...

..........back to IDE.... you choose

Tools >> Boards >> ATmega328 on Breadboard (with 8MHz internal clock)

then Tools >> Burn Bootloader >> Arduino as ISP

Do you have the 5v or 3.3v line from your MAIN Arduino connected to the target Arduino?

xl97:
hi…

you mention 328P 'variants? are you sure have the correct chips? and the correct settings for those chips?

What version of IDE are you using?.. have you tried going back to IDE v.23?

What UNO do you have? SMD version? or the DIP version? (I thought I had read UNO’s cant flash bootloaders… but I think I also read that can be ignored too…lol… and does in fact work)

** Did you get the ‘breadboard .zip’ linked to at the bottom of the page?

Extract the content?

and put it in a folder called ‘hardware’ inside you sketches directory?

So you pick your board
set your port
upload Arduino ISP sketch

…connect your target board…

…back to IDE… you choose

Tools >> Boards >> ATmega328 on Breadboard (with 8MHz internal clock)

then Tools >> Burn Bootloader >> Arduino as ISP

Do you have the 5v or 3.3v line from your MAIN Arduino connected to the target Arduino?

HI!

No no, I said 328 Variants meaning various types of 328 chips… My mistake, I should have been clearer.
See, the arduino board I’m using as the Master has the 328P SMD chip while I definitely have the Atmega 328-PU DIP on the breadboard.
I just wondered if the fact that they are both 328 types might have been causing the issues but I now know that to be incorrect and I think I’ve now got the bootloader on the 328-PU chip.

I think where I was going wrong was being fixated on the instructions at the bottom of that tutorial I linked to and trying to upload / burn to the chip with it already being in a minimal circuit.
This time around, I connected the 328-PU on the breadboard as per the first set of instructions in that tuturial entitled “Burning the Bootloader” (including a crystal) and the bootloader burn procedure seemed to work this time BUT the change in signature values for the 328 in avrdude.conf still required altering from 0x0F to 0x014 to do it. Don’t know how if that should be the case or not lol.

I can remove all but the power jumpers to my breadboard, including the crystal and capacitors and the chip is making the led I have connected to pin 13 of the PU chip blink at a constant rate, which I take as sign that it’s now running on its own internal clock and the bootload burn was a success. Also no sync errors and I had definite TX and RX on the Arduino Masterboard this time.

My next and final problem is now uploading sketches which it doesn’t seem to want to do.
I’m just working on that now…

I’ve got one or two things to try there but I may be back.

Just to answer your questions though, incase it helps and also to say thanks for replying and trying to help…

I am running Arduino IDE 1.0.3 though I do still have an older version (023) - I have the breadboard.zip installed and am running from the 5v side of the Arduino master board.
Hopefully I’ve now cracked the bootloader issue and now need to figure out how to upload a sketch to the breadboard 328 since I can’t remove the 328 on my arduino master board because it’s an SMD :confused:

Ok, think I've got all of this sussed now so we can probably mark this as solved.

To install the bootloader and get the slave chip on the breadboard to run at 8MHz internal, I needed to connect it up to the arduino master as per the instructions in section one of that tutorial (Burning the Bootloader) but WITH the crystal and ceramic caps in place first of all. This allows the bootloader to be burned and then the crystal and ceramic caps can be removed and the slave chip should be running with the bootloader at 8Mhz internal.

To upload sketches to the slave chip on the breadboard, connect up the slave chip to the master arduino board as per the instructions at the bottom of the tutorial for uploading sketches (Minimal Circuit (Eliminating the External Clock)) but if you have a master board like I do where you cannot remove the chip, simply jump the reset to ground so the breadboard chip gets the sketch and not the Master ISP arduino.

I had NO reset connected to the slave chip on the breadboard. Instead I shorted the reset pin on the arduino master to the spare ground on the master board.
I now have a stand alone Atmega 328-PU (NON P VERSION) running on a breadboard using it's owin internal clock and is running a simple blink sketch on pin 13... WOOO HOOO!

Bit of a massive learning curve that was for me but I can now move on to develop some of the stand alone projects I want to build :smiley:

Thanks everyone.. Although the answer wasn't directly given, everyone helped me think about it hehehehehe :smiley:

Hopefully this post saves someone else confusion in the future.

I have my own 3.3v @ Internal 8MHz clock thread going..

so this helps.. :slight_smile:

my question to the 'gurus' around here is:

1.) WHY is it? (and are we sure) that we HAVE TO HAVE a 16MHz crystal and 22pF caps installed on a BLANK/BARE/FACTORY chip.. to flash 3.3v/8MHz bootloader onto the chip?

Seems a bit.. odd?

What if we had a pre-assembled PCB with a blank/factory stock SMD ATMega328 TQFP chip on it? set-up for 3.3v/8MHz functionality?...and only the ICSP pins broken out? you could never bootload it?

2.)I use an FTDI cable for uploading my sketches over usb/IDE.. never my Arduino as a passive/passover device for sketch uploading..

Im hoping there arent ay problems in that are now too?

All you should need to do is choose breadboard @ internal 8MHz form board choice..and upload sketch..??