Connect Atmega8/168 Chip directly to PC via Serial

Hello!
I have Atmega8 and Atmega168 Chips. Is it possible with a “normal/average” 10$ USB2Serial Converter to let the Atmega communicate with my PC?

I can upload the Arduino Bootloader on those chips. Have done it already with the Atmega168. :stuck_out_tongue:

Yep providing you convert the +/- 12 V RS232 signals they give into the logic level signals the chip uses.

Yep providing you convert the +/- 12 V RS232 signals they give into the logic level signals the chip uses.

you need to convert the voltage and invert the logic. You may want to get something like this: http://www.nkcelectronics.com/rs232-to-ttl-3v--55v-convert232356.html

Slightly off topic, but does anyone know if the logic is inverted for the other signals as well? (i.e. RTS, DTS, etc.)

This will be a completed project, I won’t add any additional functions to it. So I can and want to build it as inexpensive as it can get.

I already have an D-Sub Connector, now I only need some resistors and an rs232 driver like a max232?
But my electronic store has about 10 different max232. The postfixes for are: CPE, EWE, CWE , EPE, EEPE, ECPE, ACPE, AEPE, AEW, ACWE, ACSE, ECSE, CSE SMD. Which shall I buy?

I didn’t find a schematic yet how to build this, which resistors to use etc… Sadly, I haven’t found yet a book about electronics especially for avr projects. So datasheets still seem like written in chinese to me. :frowning:

Does this link http://imakeprojects.com/Projects/haunted-usb-cable/Gfx/schematic.jpg imply that I do not need any RS232-2-USB Converter and MAX232?? But this is at the moment for me off-the-limits. Too complex.

connecting the serial output to a usb connector won’t help because the thing the USB plugs into expects a rather complex protocol. Implimenting the protocol is possible but not an easy thing to do.

Here is another approach that would keep the cost down.
I haven’t tried this circuit but it’s as simple as you can get
http://www.botkin.org/dale/rs232_interface.htm

If you already have the connector you just need two ten cent FET’s and a couple of 2.2k resistors.

Perhaps you can give it a try and post your results.

Good luck!

This may help for the schematic and suffexes:
http://datasheets.maxim-ic.com/en/ds/MAX3222-MAX3241.pdf

Use the schemetic on the right hand side of page 12.
The ‘x’ in MAX323x generally refers to how many inputs / outputs.
You will generally only need 1 set, or maybe 2, so the MAX3232 will usually work fine. (2 sets).

There is also a MAX232, but it needs bigger caps.

The suffexes generally have to do with package type, temp range, unleaded, etc. You probably want a PDIP package type.

This might help:
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1068/t/or

You are lucky to have such a choice near your house. :slight_smile:

BTW There are cheaper versions of this chip by other mfgrs. (i.e. Sipex SP3232EBCP)

That was excatly what I was looking for.
Though the 2 resistors and 2 mosfets cost only slightly less than the MAX 232 CPE. But they don’t need as much space. :stuck_out_tongue:

I will definately try to get this working on monday. Do you have by chance a link how to send & receive serial communication with avr ide (not arduino)? I want to try it with both, arduino & c-code.

Has anyone an idea how to power the chip? I won’t be able to use the serial connection? It does not supply power as usb does, or does it? Any workaround for this?

See also the “old” serial arduino boards that use a real computer serial programmer for programming as well as communications.

Here’s the schmetic of the serial arduino v2.

But it seems to me that the arduino is not powered by the serial connection of the pc. And I learned just now that you can power up an external device, with 10 to 40 mA and a voltage between 10 and 15V.
Using RS232-Pin4-DTR and RS232-Pin5 GND.

In normal RS232 Ports there’s a shortcircuit prevention mechanism, in the way that you can only draw 40 mA MAX.
But I will be using an RS232-2-USB Converter… what do you suggest to use to get 5V Power? Some diodes? An LM317? This time I will need cooling? To get 10-15V to 5V?

It may be easier to power the arduino from the +5v taken from the USB to serial converter if you can get access to the USB pins

Yeah, I thought so too at first. But I have no tools to open the case of the converter. So all I could do is use an usb extension cable, cut the isolation layer down to the wires, and add 1 wire to V and 1 wire to GND of the usb cable.

But I just measured the voltage from the Converter RS232-Port and it only has 6.41V.
One diode drops voltage about 0.5V? So I use 3 diodes? But then I have 6.4V -3*0.5V = 4.9V. And in the worst case only 4.8V, and the tolerance of many devices is often only up to 10%. So they may not work with 4.8V -4.9V?
Are there diodes which only drop 0.4V?

Hello you beautiful people…please answer? :wink:

I use an RS232-TO-USB Converter.
It has 6.41V.
Can diodes drop the voltage to ~5.0V?

If yes which ones and how many?

THANKS. :smiley:

Why does nobody answer? :’(

You could always use a z-diode and a resistor to get exactly 5V.

It has 6.41V. Can diodes drop the voltage to ~5.0V?

You want to connect this 6.41V signal to the Arduino through a 470R resistor. Then put an ordinary signal diode from the Arduino’s input to the 5V rail. In this way the input signal is clamped at 0.7V above Vcc which is OK.

Are any of these any use?