Ethernet or USB choice

I need a PC to communicate with an AVR microcontroller using Ethernet. I have never used an Ethernet. So

What kind of devices do I need?

Is there any sample of a project around that shows simple communication between a PC and AVR using Ethernet?

What is a good choice for communication between an AVR and PC? Ethernet or USB?

Which one is easier and faster?

I prefer a method where least programming is involved.

Regards

.

If you must use ethernet, I’d recommend the enc28J60. Its about the easiest ethernet controller to interface to a micro that I know of; however ethernet isn’t the easiest protocol to implement [it needs a fair amount of code, especially for TCP/IP. less if you can use USB].

RE: regarding protocol selection, let us know a bit more about your application, especially with regards to datarate / what you’re interfacing to.

USB with one of the USB->serial IC’s would definitely be easiest, but I don’t know if that meets your needs.

Cheers,

–David Carne

busonerd:
If you must use ethernet, I’d recommend the enc28J60. Its about the easiest ethernet controller to interface to a micro that I know of; however ethernet isn’t the easiest protocol to implement [it needs a fair amount of code, especially for TCP/IP. less if you can use USB].

RE: regarding protocol selection, let us know a bit more about your application, especially with regards to datarate / what you’re interfacing to.

USB with one of the USB->serial IC’s would definitely be easiest, but I don’t know if that meets your needs.

Cheers,

–David Carne

Thanks for responding. The application is basically measurment of pH in the seawater. The project consists of two parts:

  1. A module where AVR microcontroller and other sensors are located. The AVR/sensors in this module measures pH and communicate it to a laptop.

  2. A software running on laptop communicate with the above module, receives pH information and sends some commands to that module.

The data rate is of no concern here. I just want to read data from the module and send some commands from laptop to the AVR module to take some actions.

Regards

PS

I forgot to mention. I am looking for something like plug and play type of things where I can hook it to AVR and start going. There might be something like this that you do not have to program anything and treat it just like a black boxe and snap it to your project and start communicating. Thanks

Both are possible. You will need either a USB host/device stack or TCP/IP stack. Maybe ethernet is a little simpler in implementation. If you use USB to serial dedicated IC (like FT232 or something) then you only need serial communication (UART)

USB to logic level serial as in FTDI’s chips or modules, is 100-fold simpler than ethernet. IMO, don’t use ethernet if you are just doing point to point data where a serial / USB link is sufficient.

stevech:
USB to logic level serial as in FTDI’s chips or modules, is 100-fold simpler than ethernet. IMO, don’t use ethernet if you are just doing point to point data where a serial / USB link is sufficient.

I think I will go the way of Ethernet. For two reasons:

  1. Long distance is not problem

  2. You can connect a bridge to it and make it wireless.

However, I have to learn from the very basics on how to use Ethernet to communicated between devices and microcontrollers. Are there tutorials for beginners? Where to start? Thanks

Regards

smdFan:

stevech:
USB to logic level serial as in FTDI’s chips or modules, is 100-fold simpler than ethernet. IMO, don’t use ethernet if you are just doing point to point data where a serial / USB link is sufficient.

I think I will go the way of Ethernet. For two reasons:

  1. Long distance is not problem

  2. You can connect a bridge to it and make it wireless.

However, I have to learn from the very basics on how to use Ethernet to communicated between devices and microcontrollers. Are there tutorials for beginners? Where to start? Thanks

Regards

Once again, what does your data look like? Is it really just “serial” data? Or do you want to add a web server to your microcontroller?

If all you need to do is get data from point A (your micro) to point B (a computer on ethernet), I would suggest a LanTronix module. Its a embedded serial server which trunks data from your TTL/CMOS level serial lines and sends it over TCP/IP to a computer.

If you want to go full bore, then you need to:

  • Implement an Ethernet MAC, or an adapter to an existing ethernet Mac.

  • Implement various protocols, such as ARP, IP, and UDP + TCP. If you have the RAM and code size, you can use an existing stack like uIP or lwIP.

  • Implement DNS resolvers

All of this will be a very very tight fit on most AVRs.

theatrus:
If all you need to do is get data from point A (your micro) to point B (a computer on ethernet), I would suggest a LanTronix module. Its a embedded serial server which trunks data from your TTL/CMOS level serial lines and sends it over TCP/IP to a computer.

.

I need to connect a device to PC. This connection can normally be using RS-232 serial communication. But now I have a requirement to replace this RS-232 connection with Ethernet connection. I hope I am clear. Thanks

.

smdFan:
I need to connect a device to PC. This connection can normally be using RS-232 serial communication. But now I have a requirement to replace this RS-232 connection with Ethernet connection. I hope I am clear. Thanks

.

Then a LanTronix XPort or MatchPort is what you want. It takes care of all the details with minimal fuss.

theatrus:

smdFan:
I need to connect a device to PC. This connection can normally be using RS-232 serial communication. But now I have a requirement to replace this RS-232 connection with Ethernet connection. I hope I am clear. Thanks

.

Then a LanTronix XPort or MatchPort is what you want. It takes care of all the details with minimal fuss.

Or direct to WiFi with ConnectOne’s modules.

Hi everyone,

Thanks for your help. I appreciate that.

I found your recommendations helpful for the above purpose/problem.

But I still want to start learning about Ethernet and Ethernet based communication. Can you suggest

  1. Introductory books, tutorials, websites etc.

  2. Basic development board

Thanks

get some back issues of Circuit Cellar magazine.

They have a web site too.

see also

http://www.wiznet.co.kr/en/

and

http://www.futurlec.com/Boards.shtml

and some of the Olimex boards sold here by SFE