Go Down

Topic: Uploading sketch to standalone Arduino with Arduino SerialUSB ... (Read 1 time) previous topic - next topic

ElCaron

Aug 20, 2012, 08:04 pm Last Edit: Aug 20, 2012, 08:07 pm by ElCaron Reason: 1
... or: Flashing bootloader again, if that might have gone wrong in spite of the fact it said it was successful. :)

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.

CrossRoads

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

CrossRoads

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.

ElCaron

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.

ElCaron

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

baselsw

#5
Aug 21, 2012, 06:35 pm Last Edit: Aug 21, 2012, 06:38 pm by baselsw Reason: 1

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


Well here you have a link http://lmgtfy.com/?q=dtr+arduino+capacitor  :P. 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 :P? 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 :P*.

CrossRoads

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.

ElCaron

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

baselsw


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


Thanks CrossRoads!

Ya, indeed. That is exactly what's happening! Good thinking ;) 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!

ElCaron

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

Go Up