2
\$\begingroup\$

I need to connect the ATmega328 to a PC to show the datas that are gathered from the microcontroller, in Visual Basic .Net.

I have done it successfully using the Arduino board with USB cable.

But in order to make a PCB, I will not use the Arduino board, so I referred many articles where it stated that I need MAX232 interface in between.

Can you explain why I need a MAX232, in order to make a circuit connection between the computer and the Arduino?

\$\endgroup\$
4

2 Answers 2

6
\$\begingroup\$

MAX232 is actually a TTL<=>RS232 converter. While your AVR and PC have built in capabilities to understand each other's messages at logical level (if all communication parameters are the same encoding letter 'A' in on transmitter can be properly decoded on receiver side), they are not capable to understand each other's messages at electrical level (different voltage levels and signal inversion). That's why MAX232 is needed. MAX232 is not the only solution for this problem but it is probably the most popular. This can even be done with a pair of transistors if you need it.

Since RS232 port does not exist on many new laptops, there are ways to use USB instead of RS232. I would prefer some more complex CDC based solution which doesn't need drivers for specific OS, but the most popular and simplest for implementation seams to be FT232 with available drivers for most popular operating systems.

\$\endgroup\$
6
  • \$\begingroup\$ FTDI chips are so expensive :( \$\endgroup\$ Apr 30, 2012 at 12:09
  • 1
    \$\begingroup\$ @sandundhammika Here's a cheaper alternative: MCP2200 \$\endgroup\$
    – m.Alin
    May 2, 2012 at 18:22
  • \$\begingroup\$ If FTDI is expensive then use low speed software USB with AVR chips like here: recursion.jp/avrcdc \$\endgroup\$
    – avra
    May 4, 2012 at 12:26
  • \$\begingroup\$ instead of the Max232 u can always salvage a similar chip from an older PC motherboard. most tend to have quad ones \$\endgroup\$
    – user9597
    May 4, 2012 at 20:02
  • \$\begingroup\$ You might check this out: jim.sh/ftx I just discovered it. \$\endgroup\$
    – bjthom
    May 4, 2012 at 20:09
2
\$\begingroup\$

Suggest learning the 7 layer OSI model. The trouble is choosing a layer 1 protocol supported by a pc.

One of the protocol stacks supported by most pc's is Ethernet/tcp/ip. ENC28J60T-I/SS : This device allows you to connect with the pc using Ethernet. Any pc will support it. And the pc doesn't have to be right next to the micro, like usb does.

Another option is a module like : MRF24WB0MA/RM. This module connects a micros layer 1 using SPI, and a pc wirelessly over WiFi.

Neither of these 2 options require any extra drivers.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.