arduino in breadboard problem

Hello friends,

i am trying to burn program in atmega328 in bread board.. i have a usb to rs232 converter
it has only 4 external outpit pins such as GND,RX,TX,VCC and a DB9connector....i searched in Google about arduino in breadboard here i see two method in one method need a DTR pin (Programming an ATmega328 with Arduino bootloader via a FTDI USB-serial adapter - Electrical Engineering Stack Exchange ) and in one method only use vcc,gnd,tx,rx (Arduino - Home ) i tried both method..... for first method i used a the 4th pin of db9 connector as DTR. But in both way its sad to say i could not upload the program,both time i got the error
" avrdude: stk500_getsync(): not in sync: resp=0x00"
i cannot fix the problem yet... please help me if you can my friends...can i upload program by using this usb to RS232 converter with out DTR pin...although i have one more doubt,which programmer will we select when we upload program in breadboard arduino... thank you very much

You need a USB to TTL converter, not a USB to RS232 converter. The USB to TTL converter should also have a DTR pin, ideally.

The USB to RS232 converter output has different voltage levels that might damage the '328 chip, and also it uses 'inverted' logic whereas you need 'true' for the ATMega328.

which programmer will we select when we upload program in breadboard arduino... thank you very much

When you have a USB to TTL converter connected properly, you just upload as you would usually do by pressing the "Upload" button. You do not need to select a particular programmer because you're not using SPI.

OldSteve:
You need a USB to TTL converter

hello sir thanks for your reply..
sir i thought the max 232 ic in the converter i shown above is used to convert RS232 to TTL and vice versa...so whst the function of that max 232 there? i expect your valuable reply...thank you sir

Hi,
It looks like you should be able to use the gnd, tx, rx, and 5V pads on the board to program the 328.
Have you a link to where you purchased the adapter?

The method from the arduino site assumes you have bootloaded on the 328 already.

I load bootloader on my 328s by fitting a ICSP set of pins to my board and loading it that way.
I also load my arduino sketches that way as well on boards that have no USB or RS232 access.

Tom... :slight_smile:

TomGeorge:
I also load my arduino sketches that way as well on boards that have no USB or RS232 access.

Tom... :slight_smile:

Hello sir, thanks for your reply
i do not have the link of the USB to RS232 adapter sir,sorry....
i have the boot loaded atmega328.. i boot loaded the atmega328 using ICSP AVR burner i used this programmer for boot loading Sunrom Electronics can i load arduino sketches using this avr burner? i hope your reply as early as possible sir.. thanks for your valuable time for me

ecworks:
hello sir thanks for your reply..
sir i thought the max 232 ic in the converter i shown above is used to convert RS232 to TTL and vice versa...so whst the function of that max 232 there? i expect your valuable reply...thank you sir

You said it was a USB to RS232 converter. You made no mention of TTL-level signals on that board.

If the connections on the side of the converter PCB are TTL level, (which Tom just mentioned), they can be used for communications, but you still ideally need a TTL level DTR pin to connect via an 0.1uF cap to the '328's reset pin. You might get away with manually pressing reset if you can get your timing just right, but a DTR to reset connection is the best way to do it.

You're best off simply buying a decent CP2102-based or similar USB to TTL converter that has the DTR pin drawn out to a connector. Those converters are only a couple of dollars.

ecworks:
can i load arduino sketches using this avr burner?

Yes. Same connections as when you burned the bootloader. You don't need to use a USB to TTL converter at all. Always do the "Burn Bootloader" step first, though, because it sets the fuses in the chip.
To upload the sketch, you just use >Sketch >Upload using programmer

The bootloader is overwritten, but that just leaves more space for your real code.

Edit: There is a downside to ISP programming though - you cannot use the serial monitor for debugging. You need to use the USB to TTL method if you wish to use the serial monitor.

OldSteve:
There is a downside to ISP programming though - you cannot use the serial monitor for debugging. You need to use the USB to TTL method if you wish to use the serial monitor.

thank you sir....

sir but i think for boot loading atmega328 using avr burner we must need a arduino board..cannot bootload only with a avr isp burner..... am i right sir?

this page of arduino make me confused

ecworks:
thank you sir....

sir but i think for boot loading atmega328 using avr burner we must need a arduino board..cannot bootload only with a avr isp burner..... am i right sir?

No need to call me Sir - I haven't been knighted by the Queen yet. :smiley:

You only need an ATMega328 chip on a breadboard, with a crystal or ceramic resonator, to burn a bootloader using an ISP programmer.

I do it regularly. I don't use a breadboard as such, I use simple PCBs that I made myself, but they're the same as using a breadboard.

As I mentioned earlier - first you connect the ISP programmer, select the programmer in the IDE under >Tools Programmer, then click on >Tools >Burn Bootloader to burn the bootloader. This also sets the internal fuses of the chip.

Then, if you want to burn a sketch using ISP, you click >Sketch >Upload using programmer.

The board I use for ATMega328P chips is on the left:-
(The one on the right is for ATtiny85 chips.)
ATtiny85  328P Prog Boards.JPG

You can see how simple the boards are. You can do exactly the same on a breadboard.

Here's a schematic diagram of the connections for ISP, to burn a bootloader or upload a sketch using ISP.
On the left is the programmer, which can either be an Arduino running the ArduinoISP sketch, or a real ISP programmer like a USBASP, (which I use).
Schematic2.JPG
Edit: N.B. Although I labelled this image "Bootloader Burning Circuit", it's for burning both bootloaders and sketches. The wiring is the same for both.

OldSteve:
As I mentioned earlier - first you connect the ISP programmer, select the programmer in the IDE under >Tools Programmer, then click on >Tools >Burn Bootloader to burn the bootloader. This also sets the internal fuses of the chip.

Then, if you want to burn a sketch using ISP, you click >Sketch >Upload using programmer.

HELLO FRIEND THANKS FOR YOUR SUPPORT

here i am attaching a picture of my breadboard connection for your kind perusal.. and here i get an error when upload using programmer "avrdude: stk500_getsync(): not in sync: resp=0x00"..please go through my breadboard connection..thank you very much.....

ecworks:
HELLO FRIEND THANKS FOR YOUR SUPPORT

here i am attaching a picture of my breadboard connection for your kind perusal.. and here i get an error when upload using programmer "avrdude: stk500_getsync(): not in sync: resp=0x00"..please go through my breadboard connection..thank you very much.....

Sorry, but I can't see it anywhere near well enough to tell what everything's connected to. My eyesight is very bad. Also, I don't know the programmer's IDC connector pinouts by heart, so can't really help.
The best thing to do is use the schematic diagram I just gave you to carefully go over all of your connections. It's much easier for you to do that than it is for me.

What programmer is that one compatible with? ie What programmer do you select in the IDE? I don't recognise it, and it only says "AVR Programmer" and doesn't appear to have a name.
Are you sure it's supported by the arduino IDE?

OldSteve:
Sorry, but I can't see it anywhere near well enough to tell what everything's connected to. My eyesight is very bad. Also, I don't know the programmer's IDC connector pinouts by heart, so can't really help.
The best thing to do is use the schematic diagram I just gave you to carefully go over all of your connections. It's much easier for you to do that than it is for me.

What programmer is that one compatible with? ie What programmer do you select in the IDE? I don't recognise it, and it only says "AVR Programmer" and doesn't appear to have a name.
Are you sure it's supported by the arduino IDE?

hello friend thanks for your reply.
I selected the programmer AVR ISP now.... i did bootloading by using this programmer last time.. in that time i used "arduino as isp" method i could bootloaded my IC..the below shown are the board and programmer selection i am having now

If you continue having trouble with that programmer and the error you showed, I'd highly recommend that you buy yourself a USBASP. They're widely available on eBay, cost very little, (mine were AUD$2.56), and they're fully supported by the Arduino IDE. Your problem could possibly stem from an incompatibility between your programmer and the IDE.

OldSteve:
If you continue having trouble with that programmer and the error you showed, I'd highly recommend that you buy yourself a USBASP. They're widely available on eBay, cost very little, (mine were AUD$2.56), and they're fully supported by the Arduino IDE. Your problem could possibly stem from an incompatibility between your programmer and the IDE.

yes sir i think its the better way to buy a new usbasp.. i searched and find a similar one as you in our ebay..its that http://www.ebay.in/itm/USBASP-USBISP-AVR-Programmer-Adapter-10-pin-cable-USB-ATMEGA8-Arduino-/301786192267?hash=item4643dbd98b:g:ysIAAOSwniRWNuwM i think by this i can upload arduino bootloader and burn program too...Thank you very much for your kind helping mind sir....thank you

ecworks:
yes sir i think its the better way to buy a new usbasp.. i searched and find a similar one as you in our ebay..its that http://www.ebay.in/itm/USBASP-USBISP-AVR-Programmer-Adapter-10-pin-cable-USB-ATMEGA8-Arduino-/301786192267?hash=item4643dbd98b:g:ysIAAOSwniRWNuwM i think by this i can upload arduino bootloader and burn program too...Thank you very much for your kind helping mind sir....thank you

That programmer looks fine to me. Yes, you can burn bootloaders and upload programs with it. They're very easy to use, and you just select ">Tools >Programmer >USBasp" in the IDE, then ">Tools >Burn Bootloader" to burn a bootloader, or ">Sketch >Upload Using Programmer" to upload a program.

I've tested my USBASPs with ATtiny84, ATtiny85 and ATMega328P chips, and have never had a problem.