Pages: [1]   Go Down
Author Topic: SOLVED:Sketches to breadboard-arduino..without removing the real Arduino's chip?  (Read 1769 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: April 21, 2012, 11:25:03 am by Aaronduino » Logged

0
Offline Offline
God Member
*****
Karma: 1
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..."
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Salem, Oregon
Offline Offline
Sr. Member
****
Karma: 1
Posts: 275
Friends don't let friends use Strings
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could also run westfw's Optiloader here.
https://github.com/WestfW/
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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://www.open-electronics.org/arduino-isp-in-system-programming-and-stand-alone-circuits/
Logged

Pages: [1]   Go Up
Jump to: