Pages: [1]   Go Down
Author Topic: Uploading sketch to standalone Arduino with Arduino SerialUSB ...  (Read 1250 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 3
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

... or: Flashing bootloader again, if that might have gone wrong in spite of the fact it said it was successful. smiley

Starting from the beginning: I tried to flash an Arduino bootloader on an ATmega328P using the setup in picture 1*. Using Arduino 1.0.1, I uploaded ArduinoISP to my ArduinoEthernet, installed the capacitor, then choose "Board->Duemilanove w/ ATmega328" and "Programmer->Arduino as ISP" and then flashed. This was said to be successful (while I got an error when I removed the ATmega from the breadboard - just to check how it looks in case it goes wrong).

Then I changed the setup to picture 2 and hoped to be able to upload a sketch (while keeping the setting "Board->Duemilanove w/ ATmega328"). Unfortunately, I get an error "avrdude: stk500_getsync(): not in sync: resp=0x00". Any ideas?

* Nearly: I am quite sure reset was connected to PIN10 at the time I flashed. I pulled it out later before I remembered to take a photo.


* IMG_0520_1.jpg (209.2 KB, 1280x960 - viewed 39 times.)

* IMG_0521_2.jpg (151.51 KB, 1280x960 - viewed 43 times.)
« Last Edit: August 20, 2012, 01:07:36 pm by ElCaron » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27372
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

Doesn't look like you have power/gnd connected to 20 & 22 in the 2nd pic. You did in the 1st.
You also need a 100nF cap between "light" boards's Reset pin and the '328's pin 1 so software controlled reset can work during sketch download.

100nF caps from pins 7 and 20 would help with power supply stability as well.
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.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27372
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

http://arduino.cc/en/uploads/Main/USB_serial04-LIGTH-sch.pdf
No cap from DTR to "reset" pin on JP3. You need to have on your board.
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
Full Member
***
Karma: 3
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, thanks for the reply. Perhaps I am making an embarrassing mistake here, but  20 & 22 should be connected via the thick blue cables. I wanted to move it to the other side to keep one rail free for 3.3v from a breadboard power supply.
I added capacitors between GND 7 and and 20

I do not understand, however, why a capacitor should be between DTR and pin 1. I thought those have to be connected. I would understand a cap between pin 1 and GND, though.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW, a capacitor did it, of course. Still don't understand it electrically smiley
Logged

Sweden
Offline Offline
Sr. Member
****
Karma: 13
Posts: 257
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW, a capacitor did it, of course. Still don't understand it electrically smiley

Well here you have a link http://lmgtfy.com/?q=dtr+arduino+capacitor  smiley-razz. And in case that didn't work out for you, here is how I interpret the capacitor:

When you program the MCU the FTDI chip starts by taking DTR Low and opening the serial connection which in turn causes the the MCU to reset. The thing is the DTR line will remain low as long as the serial connection is open and won't close until the programming is over. This will of course not program the MCU because the MCU is in its reset state. So how do we do it smiley-razz? Well, put a capacitor on the DTR line and a resistor from reset to 5V. This way when the DTR line goes low the capacitor will momentarily discharge and reset the MCU. The 5V line through the resistor will recharge the capacitor which in turn changes the state of the reset line to HIGH again.

I hope that this is somewhat clear *I suck at explaining things smiley-razz*.
« Last Edit: August 21, 2012, 11:38:16 am by baselsw » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27372
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

That is a great explanation baselsw.
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
Full Member
***
Karma: 3
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Indeed, that was a good explanation. I came up with "letting through only a pulse", so I seem to have been on the right track smiley
Logged

Sweden
Offline Offline
Sr. Member
****
Karma: 13
Posts: 257
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Indeed, that was a good explanation. I came up with "letting through only a pulse", so I seem to have been on the right track smiley

Thanks CrossRoads!

Ya, indeed. That is exactly what's happening! Good thinking smiley-wink Glad that you enjoyed my explanation! But remember bro, google is your friend. I learned 99% of the electronics I know today by searching and reading a lot! You actually learn more by reading some stuff that you'd think is wasteful at the time, but believe me the time will come when you'd need and use that knowledge.

Happy Arduinoing =P!
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got on the wrong pass by reading about wiring a cap between reset and GND for stabilisation on mikrocontroller.net smiley
Logged

Pages: [1]   Go Up
Jump to: