Arduino on Breadboard, USB to TTL DIY

I am trying to create an Arduino on Breadboard. I am planning to do the bootload as well and thus I have bought an Atmega8 without the bootloader. I am planning to use a parallel programmer as my ISP for the bootloading process. And I am using an external crystal @ 16 Mhz for running the Atmega8.

Now for serial communication I can use the FT232RL FTDI USB to Serial Adapter, or a USB To TTL cable. But I want to create my own USB to serial cable. I have noticed in a picture in the forum (posted by mrbrunette, and I have attached the image), that they have created that thing only, and I cannot see any IC(the FT232RL chip).

Now I know, USB has 4 channels for communication one is GND, VCC aka +5V, D+ and D-. So I exactly want to create that, and also ask will it work for serial communication between my PC and the Atmega8, or do I need to a FT232RL chip anyway, for serial communication? Also which one is the RXD and the TXD, amongst D+ and D-? Also how should I connect the pins to the Atmega8’s RXD and TXD?

Also I haven’t yet bootloaded the Atmega8. I was searching in the forum and a lot of guys have reported problem. So is there anything to be worried about.? Also some instructions on how to bootload the atmega8 using a parallel programmer would be helpful.

http://www.gammon.com.au/forum/?id=11637

Thanks. I have already checked that page. I have read all the instructions thoroughly.

But my question is, how to make USB to serial on my own, as in the picture that I have uploaded?

Also what are the settings I should use for my Atmega8 bootloading @ 16 Mhz clock, by which I mean the fuse settings(I am a complete newbie in this).

Thanks for the help.

Also what the difference between the Atmega8 bootloader (\arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\bootloaders\atmega8) and the Atmega8 optiboot bootloader(arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\bootloaders\optiboot). Which one is better.

Also if I bootload using the first bootloader(the default Atmega8), can I change the bootloader to the optiboot later? Is the process of erasing and uploading the same as if I upload it the first time?

Also how to edit the board.txt file so that I can add the optiboot file for my Atmega8 running @ 16 Mhz external clock.

And please do not forget my original question, how to make a USB to serial connection, for communication between my PC and Atmega8?

Unless you are already an expert in USB don't waste your time making a USB to TTL device, buy one.

If you really really want to make one all the information about FTDI chips is on the .... FTDI website. But then, if you were an expert you would already know that :)

...R

sbp25: But my question is, how to make USB to serial on my own, as in the picture that I have uploaded?

I am afraid that picture tells us nothing, we have no idea from where it comes or what it describes. Well, it appears it is using a MEGA328 and presumably is using the "V_USB" library.

Point is, when the USB to TTL modules are worth less than $US1.50, why do this anyway as it seriously limits what you can do with the ATMega at the same time.

sbp25: Also if I bootload using the first bootloader(the default Atmega8), can I change the bootloader to the optiboot later? Is the process of erasing and uploading the same as if I upload it the first time?

Precisely.

Okay! So I will search for that one - USB to TTL cable. But is there any other way by which I can communicate with my PC?

There are lots of different ways for 2 Arduinos to communicate with each other from two wires, through Infra Red, wireless transceivers, bluetooth and wifi.

Wires and IR are cheap and simple and basic wireless is not very expensive. Bluetooth and Wifi add significant cost and complexity.

The problem is that PCs don't do the simple stuff. Parallel printer ports vanished years ago. USB to ttl is probably the simplest and cheapest. But bluetooth and wifi are perfectly workable. USB to ttl is necessary if you want to program the Arduinos, so why bother with anything else unless there is a specific need for it.

...R

I was thinking to using instructions from here http://arduino.cc/en/Main/StandaloneAssembly to do the communication between my computer and Arduino. But I have seen here and also in (http://arduino.cc/en/Main/Standalone), that they do not use the RTS function, despite being available from the TTL logic.

What is the use of this RTS? And will not using the RTS bring down my functionality in terms of codes written or interacting with my computer?

I have been reading that if one does not have the RTS from the computer, then each time I upload a new sketch I have to manually press the RTS switch manually to prepare the Atmega8 to receive a new code. Is this true? Is there a workaround for it using the serial connection from this http://arduino.cc/en/Main/StandaloneAssembly.

Also if I bootload my Atmega8, and anything goes wrong, will my Atmega8 be unusable, or can I again bootload it?

sbp25: Okay! So I will search for that one - USB to TTL cable. But is there any other way by which I can communicate with my PC?

Yes, but they are all much more difficult. I think you will have more than sufficient challenges just getting your breadboarded system going without going out and looking for trouble.

sbp25: I have been reading that if one does not have the RTS from the computer, then each time I upload a new sketch I have to manually press the RTS switch manually to prepare the Atmega8 to receive a new code. Is this true?

That is indeed how you do it. You press the reset button for about half a second as soon as you see the "Binary sketch size: xxxx bytes (of a 32256 byte maximum)" message from the IDE.

sbp25: Is there a workaround for it using the serial connection from this http://arduino.cc/en/Main/StandaloneAssembly.

I would suggest you forget you ever saw that page! It is so badly "broken" that is really should be simply removed from the Arduino descriptions.

sbp25: Also if I bootload my Atmega8, and anything goes wrong, will my Atmega8 be unusable, or can I again bootload it?

If you mean downloading a program using the bootloader, then it is almost impossible to cause any permanent harm. You just reload it again, correctly. Downloading using the ISP (USBASP) it is possible to set the "fuses" in such a way as to make it very difficult (needing a "high voltage" programmer) to recover, but - not easy to do that much damage still.

sbp25: But I have seen here and also in (http://arduino.cc/en/Main/Standalone), that they do not use the RTS function, despite being available from the TTL logic.

What is the use of this RTS? And will not using the RTS bring down my functionality in terms of codes written or interacting with my computer?

The use is that it makes downloading immensely more reliable.

The critical thing is to include the 0.1µF capacitor between the RTS line from the TTL converter and the reset pin of the ATmega (with the 10k pull-up).

The only limitation with this is that opening the USB port at any time will always reset the ATmega. Of course, if you are breadboarding it, you can include a switch, or just lift the wire when you do not want it.

I would suggest you forget you ever saw that page! It is so badly "broken" that is really should be simply removed from the Arduino descriptions.

So do you mean to say that the things on that page does not work? Or does it work because I am thinking to use that reference for communication between my PC and Atmega8, for the mean time, until I find USB to TTL in my locality for a cheaper price.

Btw can anyone tell me the standard fuse settings of the Atmega8. When I will bootload I will be using these settings(hedefault one) in boar.txt.

atmega8.name=Arduino NG or older w/ ATmega8

atmega8.upload.protocol=arduino atmega8.upload.maximum_size=7168 atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xdf atmega8.bootloader.high_fuses=0xca atmega8.bootloader.path=atmega8 atmega8.bootloader.file=ATmegaBOOT-prod-firmware-2009-11-07.hex atmega8.bootloader.unlock_bits=0x3F atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8 atmega8.build.f_cpu=16000000L atmega8.build.core=arduino atmega8.build.variant=standard

But if I want to use the optiboot bootloader for my Atmega8, what will be the correct entry in the board.txt file. Help!

Also in the original one, upload rate is set at 19200 which is the baud rate(correct me if I am wrong). So how can I change it to 115200, the highest? Or does the Atmega8 does not support such speed of communication? And finally does the baud rate matter, and when does it really matter?

sbp25: So do you mean to say that the things on that page does not work? Or does it work because I am thinking to use that reference for communication between my PC and Atmega8, for the mean time, until I find USB to TTL in my locality for a cheaper price.

Well, it is curious. The diagram is wrong because one of the inverters used as an ersatz RS232 to TTL converter, is clearly drawn wrong. But instead of correcting the diagram, they tell you to simply swap two pins of the inverter! How much sense does that make as an "errata"?

I think the page should be either corrected properly so that it clearly explains how you might "fudge" the interface, or simply removed as a bad idea. Otherwise people are going to misunderstand what it is all about and cause themselves - and consequently people here - unnecessary problems.

Yeah, I have seen that problem, but does the fix works, I mean changing the the inverter pins?

Hey I have started the process of assembling the Atmega8 on the breadboard with all the components, I am using a Parallel Programmer to bootload my Atmega8. Now when I select "Arduino NG or older w/ ATmega8" as the Board and the Parallel Programmer and the Programmer, and start the process of bootloading I get an error, as follows,

avrdude: AVR device not responding avrdude: initialization failed, rc=-1 avrdude: Yikes! Invalid device signature. avrdude: Expected signature for ATMEGA8 is 1E 93 07

I tried checking my connection for errors and I still get the same thing. I kept the board sitting for more than 20 minutes and there is no new output except these 4 lines. Also the pins 13(Arduino pin #) LED glows when I connect the parallel programmer to the parallel port, and this is expected as it is(the LED) connected at pin 19 of the Atmega8 and these is also the SCK to pin 19 from the parallel programmer and also the pin 18 from the parallel programmer is connected to the ground. So the circuit completes and the LED glows. Nothing unusual in my opinion. Some users have said removing the LED solves the problem, but in my case removing the LED did not solve it.

Any help on what the problem might be?

Btw I am using an external crystal clock @ 16 Mhz.

sbp25: Yeah, I have seen that problem, but does the fix works, I mean changing the the inverter pins?

It should, but I might be just a trifle worried that the RS-232 interface is functioning as it should. Also whether you need to set the "handshake" on the RS-232 - generally looping RTS to CTS and DSR to DTR.

Loop Tx back to Rx through your two inverters with the chip removed, and see if the "Serial Monitor" echoes when you type something and "Enter".

Okay I will try that and post in the forum about what I find.

And the previous question about the bootloading problem of the Atmega8. Any help on that?

Since I did not get an FT232 breakout board in the locality, I am using the http://arduino.cc/en/Main/StandaloneAssembly serial connection for communication between my PC and the Atmega8. The FT232 or in general the Arduino carries an LED indicating the RXD and TXD signals. Is there a way by which I can also make such a connection, to make the LED glow whenever there is a data transfer?

Btw do not forget on the Atmega8 bootloading issue, it still gives the same problem.

I'm afraid I am completely confused with all this discussion about alternatives to USB.

Can you set out again what is the current problem with all of the connections and software clearly described?

...R