unable to upload programs to bread board microcontroller

i have a microcontroller (atmega 328p-pu) connected on a bread board. the connections seem to be correct.
i was able to upload a boot loader to it using http://arduino.cc/en/Tutorial/ArduinoToBreadboard
and then using http://www.digibay.in/pl2303hx-usb-ttl-uart-programmer?filter_name=usb i uploaded a the ReadAnalogVoltage example from the ide.
it worked.

now when im trying to upload a new program into the micro controller, the program just wont get uploaded.
it gets stuck at uploading and stays that way for a very long time, no error message.
i think last i tried it, was that way for about 10 minutes or so.

if however i open the serial monitor with the correct port number, i can see that the program is still working.
i keep getting random values from the analog read because the analog pin is floating.

any clues as to what is wrong ? and how to fix it ?


One problem is that you are missing the 10K ohm resistor to +5 on reset, pin 1.

There could be other problems though. I can't tell at this point.

actually the resistor is there, its just hidden behind one of the wires.

You are missing the auto-reset circuit. You should have a 0.1uF capacitor between the reset pin and a DTR pin from the USB serial adapter. Otherwise you will need to hit the reset button just when IDE finishes compiling the sketch.

It worked right after you loaded the bootloader, because the bootloader will usually continue running if there is no sketch present.

hiduino you were right about the reset thing when the ide is nearly done. this way i am now able to upload a program. to make it work automatically, which one is the dtr pin ? i only have +3.3v +5v txd rxd gnd

also does it have to be a .1uF ? can i maybe use 10uF ?

Here is one solution:


Any update?

fuzail: which one is the dtr pin ? i only have +3.3v +5v txd rxd gnd

also does it have to be a .1uF ? can i maybe use 10uF ?

Unfortunately, your USB TTL UART board does not support the DTR breakout. So you have two options. Just use the reset button and hit it right after the IDE finishes compiling the sketch. Or modify your USB TTL UART board to breakout the DTR pin (see the link that @JoeO provided).

If you do modify your USB TTL board then use the 0.1uF capacitor between DTR and the reset pin.