SOLVED:Sketches to breadboard-arduino..without removing the real Arduino's chip?

There are good instructions for uploading sketches to a breadboard-arduino using an existing (real) Arduino, wired them up like this- http://arduino.cc/en/Tutorial/ArduinoToBreadboard . But my pins are about to break from pulling the chip several times.

I am able to burn the bootloader using the following command line:
avrdude -F -p m328p -c arduino -P com3 -b 56000 -u -v -U flash:w:AT328.hex ..Success!

I can successfully (inadvertently) upload files to the Duemilanove's chip using the same, even though I'm actually trying to program the connected breadboard arduino:
avrdude -F -p m328p -c arduino -P com3 -b 56000 -u -v -U flash:w:twoblinks.hex (it even accepts 328P as the chip since -F ignores the signature)

The breadboard ATMega328P has the bootloader and I can program it if I put it in the Duemilanove board, so the chip seems to be working fine. However, I don't know how to use the FTDI serial on the Duemilanove to program off-board without pulling the chip on the Duemilanove.

I could sure use help on wiring it up correctly. Any ideas?

I read the page you linked, and while I never tried those instructions myself, it seems to me what that page shows is exactly how to upload a sketch to an atmega with an arduino bootloader on it without taking it off the breadboard.

My 2 cents...

Thanks, but per that link and others I've researched, to burn the bootloader one can leave the chip in the Duemilanove board. I did that. It worked. However, to upload sketches, that's not the case (see quote below).

So what I'm asking is how to use an Arduino as an FTDI programmer without removing the chip. Seems like it could be possible using AVRDude, if not the Arduino software (which also uses AVRDude). Or it might be possible by connecting to a different place on the Duemilanove board instead of just the pinouts.

I've searched a lot and while people speculate that the chip can be left in, and it will just program both chips, that is not what I'm finding. Only the chip in the Arduino gets the new sketch.

Anyone?


"Uploading Using an Arduino Board
Once your ATmega328p has the Arduino bootloader on it, you can upload programs to it using the USB-to-serial convertor (FTDI chip) on an Arduino board. To do, you remove the microcontroller from the Arduino board..."

Yes - remove the chip from the Duemilanove. Add a few pins to X3, and follow this.
http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

Connect SCK, MISO,MOSI, Reset, +5, Gnd (the pins on the ICSP header) to the pins on your breadboard, and program the breadboarded part if you want to go bootloader-less.
Otherwise, if it has a bootloader, connect Reset to 100nF cap to reset pin, Tx,Rx, +5, Gnd, and download sketches, again with the chip left off the Uno board.

In both cases, you are using the FT232 chip to control the lines.

Aaronduino:
However, I don't know how to use the FTDI serial on the Duemilanove to program off-board without pulling the chip on the Duemilanove.

So I don't know if this will help, but I was reading the forum today and came across this old forum post: http://arduino.cc/forum/index.php/topic,67509.0/topicseen.html

Looks like it's worth trying step 1 - insert a jumper between RESET and GND to disable the processor.

If it works for a loopback, I don't see why it wouldn't work for what you want to do.

Just a thought,

Brad (KF7FER)

You could also run westfw's Optiloader here.

Connect source D10 to Reset, D11 to D11, D12 to D12, D13 to D13, power & gnd.
Optiloader sketch queries the new part to see what it is, then downloads a sketch into it.

Update: I did find a way to do this some time back, and am posting to help someone else. The only issue is that downloading the sketch in this manner programs BOTH ATMEGA, meaning the one in the real Arduino board and the breadboard. Not an issue but you need to know that you'll lose the Arduino ISP sketch on the real Arduino so just have to re-download it.

Attach the breadboard arduino to the real arduino as here using the "Burning the Bootloader" configuration NOT the picture below, which shows how to do it IF you remove the ATMEGA from the Arduino (which I was trying to avoid): http://arduino.cc/en/Tutorial/ArduinoToBreadboard

Also, in this configuration, you need to connect a 120 ohm resistor from reset to 5V on the Duemilanove/real Arduino board.

Then, in windows, open a DOS command window and go to the directory that has avrdude in it (you have to enter this line while in that directory, I believe). I won't go into all that here since it can be googled. The following command worked for me, where "three.hex" was the compiled Arduino code that was found in a temp folder (you can search for how to find the compiled code).

avrdude -F -p m328p -c arduino -P com3 -b 19200 -u -v -Uflash:w:three.hex

Last hints: make sure you didn't erase Arduino ISP from a previous attempt. Reload it if needed. Remember the 120 ohm resistor on the main board. Use the avrdude command that ignores the chip identification code from the breadboard ATMEGA (if it isn't in the line above), Mess with baud rate if needed. I believe some had success with higher rate.

If someone gets this to work, please post more details for the community. I may have forgotten something but above is what I had in my final notes.

Doh. And here's another set of instructions that is probably better. Just found this.

I´ve found a programatic solution on the youtube video Upload sketches to breadboard Arduino Uno & Pro-mini - YouTube .
Credits for youtube user "Alan Fok".

The solution consists in disabling programmatically the Atmega328p-pu serial communication on arduino board ( uploading a sketch).

I´ve used an Arduino Uno R3 board to upload a sketch to another Atmega328p-pu. The instructions are below :

  1. Upload the sketch "serial-disable.ino" to Arduino Uno R3 (download the sketch from https://onedrive.live.com/?id=634E963038D1F71A!644&cid=634E963038D1F71A );

  2. Suposing the breadboard ATMega328P has the bootloader, make the connections as described in https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard in the section "Uploading Using an Arduino Board", without removing the ATMEGA IC from the board;

  3. To upload the sketch to microcontroller, select "Arduino Duemilanove or Nano w/ ATmega328" from the the "Tools > Board menu" then upload as usual.

It realy works for me. After all, the new ATMEGA is with the loaded sketch and the Arduino Uno R3 can be loaded with other sketches without any problem.