This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Ethernet Code for LPC 1769

Hi all,
We are planning to use Ethernet in our project with LPC 1769 processor. We are using DP83848(national instruments) transceiver.

The problem for me is that i don't where to start with. what are the steps to follow to write code for ethernet. Why should one use TCP/IP stack? How to test the code we have is correct or wrong??

Please guide me through this....

Thanks,
Pavan

Parents
  • Simple. You do not write a TCP/IP stack. It's a large task, and if you know how to write one, you wouldn't have asked in the first place.

    So you either buy a stack, or you find a free one. Keil has a commercial stack (but requiring you to pay a second time for getting the source code). Google has other commercial and free stacks.

    How to test? The stack you use should preferably come with some sample code. If not, then select a different stack.

Reply
  • Simple. You do not write a TCP/IP stack. It's a large task, and if you know how to write one, you wouldn't have asked in the first place.

    So you either buy a stack, or you find a free one. Keil has a commercial stack (but requiring you to pay a second time for getting the source code). Google has other commercial and free stacks.

    How to test? The stack you use should preferably come with some sample code. If not, then select a different stack.

Children
  • NXP have some special deal(s) with some stack providers (NicheLite?) - you'll be able to find it on the NXP website...

  • Hi,
    NicheLite has provided a sample project code for lpc17xx series in NXP website. I tried to compile it in keil, but was getting so many compile time errors.

    Is there any other TCP/IP stack which is easier to understand and work with?????

    Coz...i am getting nightmares with nichelite code (its toooooo big for me to understand).

    Pavan

  • Yes, there are dozens of them!

    eg, see: http://www.keil.com/tcpip/

    "easier to understand and work with?????"

    I've used NicheLite with other processors (not NXP), and I didn't find it particularly hard to understand or work with.

    "its toooooo big for me to understand"

    TCP/IP is not trivial!

    The size & complexity of a TCP/IP stack is largely governed by the size & complexity of the TCP/IP protocols that it implements.

    Therefore, if NicheLite is "toooooo big" for you to understand, this probably means that you need to spend some more time developing your embedded 'C' skills to the point where you can understand it.

    "was getting so many compile time errors"

    Dealing with compile-time errors is a standard part of the software development process - again, this suggests that you need to spend some more time developing your embedded 'C' skills.

    Of course, you also need at least a basic understanding of TCP/IP itself

    compnetworking.about.com/.../TCPIP_Transmission_Control_Protocol_Internet_Protocol.htm
    www.cis.temple.edu/.../sockets.html
    burks.bton.ac.uk/.../winsock.htm

    Possibly the smallest TCP/IP stack is uIP - as it's specifically designed for small 8-bit processors:
    www.sics.se/.../Main_Page
    whether this makes it any "easier" to understand is another matter...

  • Hi Neil,
    Thanks neil for your suggestion.

    Its true i have to concentrate more on C skills.

    Can you tell me how to start working with the TCP/IP code that was given in NXP (niche-lite). I mean how to start looking at the code and make it useful for my application.

    Are there any specific things to consider while porting the stack to the processor i intend.

    Thanks for the links.

    Pavan

  • Exactly the same way you'd start looking at any other code!

    Read the Documentation - look for examples, app notes, etc (remember that Nichelite is not unique to NXP)

    Ensure that you understand at least the basics of TCP/IP

    "Are there any specific things to consider while porting the stack to the processor i intend."

    The Documentation will tell you that!

    As far as the compiler is concerned, it's all just source code - it has no knowledge of TCP/IP or any other application details.

    For compiler errors, you need to realise that just one simple error early in a source can lead to a very large number of resulting errors in the rest of the file.

    eg, if a needed header can't be found, that will cause one error; and then everything else that relies upon something from that header will cause another error (or even errors) - so simply fixing the first error will also remove all those resulting errors!

    Again, this is a perfectly normal and standard part of the 'C' development process!
    Do not be alarmed by large numbers of errors - just start at the first one, take care to understand it, then fix it, then move on...