Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    43

    Question Ethernet with microcontrollers

    I have been asked to add Ethernet to the microcontroller on my project. I'm using an 18F4553 at this time. The microcontroller needs to handle the IP itself. I see the PIC18F97J60 supports Ethernet, but I don't find designers going this route, seems the preferred method to add Ethernet is to use something like the Lantronix XPort Pro. I also don't find many code examples to implement Ethernet in Microcode. Looks like a Nuts-N-Volts article was discussed several years ago.

    This request comes from a steering group for the project, one person believes the Ethernet needs to be built on the microcontroller to future proof the board from components getting phased out. At this time the communication is from the USART to a wireless network modem that is embedded on the circuit board. The fear is the network modem may change their footprint, or not make the embedded wireless modem option at some future time. If that happens then we would need a hardware change to the circuit board at that time. The same argument was made against using something like the Lantronix serial to Ethernet adapter.

    So my questions are; what are my options to add Ethernet to the Microcontroller? Is there Pic Basic support for Ethernet, what I found didn't look friendly? Would I need to change to a different language like "C" and upgrade to something with more processing power to reliably incorporate Ethernet to the microcontroller/microprocessor?

    Let me know if I missed something obvious, like the thread that has all the information that I'm looking for.

    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,131

    Default Re: Ethernet with microcontrollers

    Hi,

    If you absolutely "must" avoid offloading the Ethernet stuff to a module then, and I hate to say it, PBP probably isn't your best option. I'm certainly no expert on this but having written PBP code for the Wiznet W5100 chip to do DHCP, SMPT, SNTP etc which are all "high level" stuff "on top of" the TCP and UDP protocols (which the W5100 handles in this case) I can tell you that implementing (and using) a full TCP/IP stack in PBP is what I personally would consider a monumental task. Yes, it has been done, at least to some extent. I have not tried it and I agree that it's far from "friendly".

    With that said, you're always running the risk of a part getting obsolete forcing a hardware and/or software revision. I don't know if you're building dozens or tens of thousands of this product but I'd try to talk to the people at Lantronix, Tibbo, Wiznet etc to see if you can get an idea of the planned lifetime for the potential product and possibly stock up on it as it approaches EOL so you have time to re-think the situation at that time.

    Microchip has a TCP/IP stack for their C-compiler, if you "must" incorporate the Ethernet stuff in the main microcontroller I'd probably read up on that (personally I don't "do" C so I'd be in the shit). Then, if you're redesigning the product to use a new microcontroller perhaps moving to a 32bit one which I'm sure will handle the Ethernet stuff much better than an 8-bit one. But, that too, is indeed a big task. Much bigger than being forced to switch to a different module 5 years down the road I'd think.

    /Henrik.
    Last edited by HenrikOlsson; - 18th August 2017 at 07:36.

  3. #3
    Join Date
    Sep 2009
    Posts
    609

    Default Re: Ethernet with microcontrollers

    I have been working on and off on PBP Ethernet, and it's not easy. And not friendly, at all. Base of my work is article from Nuts and Volts, and building from there using various examples from net.
    But one thing that surprises me a lot is that PBP is much more efficient than C. Lot less typing to do same thing, and as far as I can see much smaller code. But very little additional stuff you can put in 128K...

  4. #4
    Join Date
    Oct 2009
    Posts
    535

    Default Re: Ethernet with microcontrollers

    Years ago i purchased an Ethernet module thinking that it would be as easy as setting up serial port - how wrong was I !

    In my opinion PBP is seriously lacking in support of such things, but as Henrik has explained there is often a reason which in this case is the complexity of the protocols etc.

  5. #5
    Join Date
    Aug 2003
    Location
    Australia
    Posts
    924

    Default Re: Ethernet with microcontrollers

    There was a “Web Server in a Box” project a few years back with released source (C), and I got that working ok.
    It’s a dsPic that uses one of Microchip’s companion ethernet controllers for a largely 2 chip + SD card web server.
    The project was based on code that MC provide for a similar development board of their own.

    Schematics and source for it are pretty easy to Google. It was popular a the time for tinkerers including myself.
    http://www.siliconchip.com.au/Issue/...1?res=nonflash

  6. #6

    Default Re: Ethernet with microcontrollers

    Much more 'logical' to add a module, and a wifi module at that. These modules today have 32 bit processors and big memory for the tasks for network and wifi. Plus some are only few $ and a fraction of the time to do network settings as opposed to programming all the tcp, ip, udp, password, etc, and all other kinds of routines and functions that are already on these modules.
    Last edited by amgen; - 18th August 2017 at 18:04.

  7. #7
    Join Date
    Oct 2004
    Posts
    448

    Default Re: Ethernet with microcontrollers

    Quote Originally Posted by amgen View Post
    Much more 'logical' to add a module, and a wifi module at that. These modules today have 32 bit processors and big memory for the tasks for network and wifi. Plus some are only few $ and a fraction of the time to do network settings as opposed to programming all the tcp, ip, udp, password, etc, and all other kinds of routines and functions that are already on these modules.
    + that statement.

    Using one of the wifi modules amgen hints at is by far the easiest way to extend TCP/UDP support to a microcontroller.

    Considering the popularity of the modules, they are unlikely to be discontinued in the near future. If AT ALL the form factor you design around does become obsolete, you could use a personality module-like pcb to accomodate the new one.

  8. #8
    Join Date
    Apr 2014
    Posts
    63

    Default Re: Ethernet with microcontrollers

    I recently conquered USB communication with a PIC18xxK50 and HIDmaker software. Trace is the company that produces HIDmaker. They also have TCPmaker for ethernet. Review Dr. Bob's site for ideas:

    http://www.tracesystemsinc.com/Table/tcp/tcpmaker/

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,538

    Default Re: Ethernet with microcontrollers

    TCPmaker is great tool, only for C user though...

    Ioannis

  10. #10
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    43

    Default Re: Ethernet with microcontrollers

    Thanks for everyone's input, I'll use your reply's to update the steering group.

Similar Threads

  1. send data between 2 microcontrollers by ir(infrared)
    By FADI984 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd November 2011, 07:20
  2. Suggestion for textbook on PIC microcontrollers
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th May 2010, 21:07
  3. Programming for Microcontrollers in C
    By erice1984 in forum Off Topic
    Replies: 1
    Last Post: - 1st May 2009, 17:12
  4. PBP compilers for other microcontrollers.
    By Archangel in forum PBP Wish List
    Replies: 2
    Last Post: - 5th February 2007, 08:25
  5. Operating system kernels for microcontrollers!??!
    By Armando Herjim in forum General
    Replies: 2
    Last Post: - 3rd October 2006, 21:47

Members who have read this thread : 28

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts