Ethernet (in general)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ethernet (in general)

2,215 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Wed Jul 23 00:03:58 MST 2014
Back in the old days, when someone wanted data sent back to his computer, we used RS232.
Now customers want Ethernet, and it's something I don't know enough about (I can configure a computer on a network, and make up the cables, and that's about it), so I think I'd better learn.

Any suggestions as to where I should start reading?

Am I correct in thinking that if all I need to do is send a few bytes of data back to a computer, then the best way would be a separate ethernet interface, not using an LPCxxxx with one built in?


There's no time pressure on this - I wasn't so daft as to promise a project with an Ethernet interface when I don't really know what I'm doing!
Labels (1)
0 Kudos
Reply
6 Replies

2,145 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hlsa on Tue Jul 29 08:25:34 MST 2014
There are two basic options:

1.
You use a standard microcontroller + an external ethernet device, which is connected to your microcontroller, e.g. via UART. In one of our products we use for example the XPort device from Lantronix, which is quite simple to use.
Such a solution is easy to implement but the external devices aren't cheap. Though it is a good solution for lower volumes.

2.
Once you have higher volumes and costs-per-piece is more important than development costs, you better go with a Microcontroller that has an integrated ethernet mac (e.g. LPC43xx) plus an external phy.
You will need an IP-Stack. Some people prefer a freeware solution like lwip. I prefer a commercial solution due to the support and documentation. We bought for example the Sciopta RTOS plus the Sciopta IP stack, which works very good. However, you will also find plenty of other commercial products. A very good commercial IP stack which doesn't require an RTOS is available from Sevenstax.

However, another important topic is howto implement the communication from your PC to the embedded device an vice versa. You can chose between the trasnsport protocols TCP (reliable) and UDP (fast) or you can even use any higher level protocols like Telnet.

A good starting point would be finding a book, which gives an introduction to IP networking.
I do have an excellent book (Anatol Badach, Erwin Hoffmann: Technik der IP-Netze; TCP/IP incl. IPv6 Funktionsweise, Protokolle und Dienste), however, it is written in German. There should be similar books available in english, e.g. "Douglas E. Comer. Internetworking with TCP/IP - Principles, Protocols and Architecture."

Best regards,
Holger
0 Kudos
Reply

2,145 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Thu Jul 24 06:09:49 MST 2014
You might consider to use a 'modern' M3 like LPC13 or LPC15. Usually they are >2 times faster than M0.

Just migrated a project and faster crystal, better pipeline and better calculation surprised me with speeding up my calculation part 5 times...

EEPROM, SWM and 256k Flash are also very useful (no, I'm not selling this chips)  :)

LPC17 is a very old M3 version and not available in smaller footprints like LQFP48... 

If you are planing to draw your own board it's of course also easier to avoid an Ethernet PHY...

I'm not sure how you want to transmit your data. Sending a simple UDP frame in a LAN isn't very smart, but easier than TCP...
0 Kudos
Reply

2,145 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Thu Jul 24 05:37:25 MST 2014
Thanks, both of you. Lots of useful information.

I've a bit of an idea how an ethernet message works, so lwip is of interest.

Could someone tell me how much software overhead is involved if I use an LPC17 with the ethernet interface?

If I take as an example the current project I'm working on - it has an LPC11 which is quite busy doing digital audio things.
Obviously an LPC17 is a bit quicker, so how much of its time will Ethernet occupy?
The project in question only sends a line of text every minute via the RS232.

I think that probably the Digi Connect-ME is the way to go, especially as it becomes somebody-else's-problem if the customer can't get the ethernet side of things to work!

Has anyone used the Microchip ENC28J60? Is that something I should be looking at?

I've arrived here from the electronics engineering side, rather than the computing side, so digital audio is much more my idea of fun than Ethernet!

Anyway, I'll read the book. I like books.
0 Kudos
Reply

2,145 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Wed Jul 23 20:16:40 MST 2014
I forgot to mention the quickest and dirtiest solution.

Check out the "Digi Connect-ME" (and -WE wireless) at www dot digi dot c-o-m.

These are cheap (c.a.US 20?) modules (the size of an ethernet connector port nearly) that you
can add to a PCB design.

You can even buy ethernet to serial dongles (similar to the more familiar USB-Serial dongles).

You plug the eternet cable in  and the device squirts out RS232 to your board and takes RS232
from your board and squirts out TCP to the net.

All the complicated stuff is done for you, you just have to set up the IP address etc. on the Digi.
They supply apps to do this from the PC/LinuxBox.

Of course, there is a cost and it takes all the fun out -- but how much would your dev time
and learning cost.

It's an option we as a medium specialist company (2 Million UK pound turnover) have used this
very often to give customers IP on our 'standard' RS232 designs. In fact, we have a variant board
that incorporates the Digi because it is needed so often.

Cheers, Mike
0 Kudos
Reply

2,145 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Wed Jul 23 20:12:16 MST 2014

Quote: kabikov
Google "lwip" and may be "rtos".



I think that kabikov has missed your point. I am guessing that you want to know how
Ethernet (and UDP/TCP) actually works. This is a big subject -- for the original scoop
get hold of "TCP Illustrated Volume 1" by W. Richard Stevens [There are dodgey pdf's
etc. if you are a student.] And there are web-tutorials about this e.g. www tcpipguide com/free/t_toc.htm
[replace spaces with dots -- spam filter!?] and use Wikipedia for Ethernet/IP/ARP/Echo/UDP/TCP
paket format for pretty (and pretty useful) pictures.

However, if you just want to write TCP/UDP apps and do not want all the gory implementation
details, google "winsock tutorial" or "sockets programming" and other cominations.
Some info is BSD (unix/linux) based, but the concept are universal -- Microsoft can't make
TCP proprietry! E.g. Beej's Guide to Network Programming (http://beej.us/guide/bgnet/)

Implementing the NXP network stack as kabikov says check out LpcOpen. (which includes lwip
lwip as a separate project is obsolete (but still available).

Sorry if I missed the point; in which case just ignore me -- Mike


0 Kudos
Reply

2,145 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kabikov on Wed Jul 23 05:20:42 MST 2014
Google "lwip" and may be "rtos".
0 Kudos
Reply