Adding TCP/IP Ethernet to PIC - how?


Closed Thread
Results 1 to 40 of 65

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    38

    Default Adding TCP/IP Ethernet to PIC - how?

    Hi All,

    After searching a few threads with not quite the answers i'm looking for, i'd like to know what the preferable way is, to add TCP/IP into a PIC project.

    I'm looking at using the ENC28J60 Ethernet interface, but not sure if that's the popular choice for a newbie?

    From what i (mis)understand, some interfaces are somewhat intelligent and handle all the tcp/ip protocol itself, whereas the smaller cheaper interfaces are nothing more than a physical interface into the pic, and i'd need to code a LOT more low-level tcp-handling routines.....something i don't want to do.

    So, trying to keep things as simply as possible, are there preferred interfaces i should go with? is there a 'how to get started/basics' thread hidden somewhere here or elsewhere on the net?

    Ultimately, (like most people) i'd like to control my Pic project via the net (or internal network), simply toggling a bit on/off from a Webpage elsewhere would be nice, or serving a webpage telemetry/status indication that i can view anywhere would also be of great use.

    Thanx in advance,
    Marty.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166

    Default

    gtvmarty, I had in the past thought about designing my own hardware but have recently purchased one of the NET232 interfaces for my solar array tracker. It is easy to use and I can now connect to it anywhere in the house with my laptop over the wireless router.. It cost about $100 but an investment I think is well worth it....

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Jul 2008
    Posts
    38

    Default

    I've just been looking thru some ethernet items from 'Tibbo', they seem to have a lot of positive support (simple to use etc) when i look thru some other threads on here.

    Marty.

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    If you are in the USA you should avoid Tibbo like the plague. They have discontinued some of their devices with absolutely no warning (obviously due to patent infringement issues) and repeatedly misrepresented why they were discontinued and when they would offer a replacement.

  5. #5
    Join Date
    Jul 2008
    Posts
    38

    Default

    I'm in Australia, but it sounds like i shouldn't touch it at all no matter 'where' i am

    Thanx for the headsup.
    Marty.

    Quote Originally Posted by dhouston View Post
    If you are in the USA you should avoid Tibbo like the plague. They have discontinued some of their devices with absolutely no warning (obviously due to patent infringement issues) and repeatedly misrepresented why they were discontinued and when they would offer a replacement.

  6. #6

    Default

    net232... i'm guessing HS serial to ETH remodulator... like the max232?

  7. #7
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Any update?

    Hi gtvmarty,

    Any update from you about this thread?

    I'm starting in TCP communication and have exactly the same questions you had.

    Would be nice to see where you have got so far
    Roger

  8. #8
    Join Date
    Jul 2008
    Posts
    38

    Default

    Hi Roger,

    No assistance at all, we're on our own ;-(

    Using TCP/IP is a major secret, and *anyone* who's mastered attaching an ethernet-tcp/ip adapter to their pic is happy to say "i've done it" but not keen on saying "what/how i did it".... ;-)

    Even the microchip text(s) state "by using the microchip tcp/ip stack...."

    Yeh, great, HOW do we use it, .....

    Most of the users are no help help either, MANY of them say this.... "i received my ethernet adapter today, plugged in onto my pic and was connected in no time".......

    what the F*#K is the point of adding empty comments like those....how does that help anyone....sheesh....

    Good luck to you mate.

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Most of the users are no help help either
    Really?? I used DT's search for ConnectOne and found this
    http://www.picbasic.co.uk/forum/show...4859#post84859
    A complete example using a ConnectOne module for sending email and FTP.

    No assistance at all, we're on our own ;-(
    Yup, I figure you might be now..
    Good luck.
    Dave
    Always wear safety glasses while programming.

  10. #10
    Join Date
    Jul 2008
    Posts
    38

    Default

    thanx mackracket for the link/help....

    However, please note your informative post was posted much later than my initial postings/responses.....

    I'm sure as time went on, more and more people kept badgering away to find answers....

    Don't get me entirely wrong, the companies themselves have documentation that isn't exactly informative, and HIGHLY assumptious.....

    As i pointed out above, microchip's datasheet simply said "just sue the stack....." with no mention about HOW to use it, or what commands you need from your pic to their interface........lack of REAL documents is what kills products overnight...

    amen!

  11. #11
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    @gtvmarty,

    Maybe you are asking too much.

    Back near the beginning of the thread, I recommended ConnectOne's nano LANReach. As far as interfacing with it via serial, it is identical to the ConnectOne wireless module mackrackit used. And, while they don't offer any PIC code, the ConnectOne documentation is excellent. Anyone with a modicum of experience should be able to create something similar to mackrackit's code (not to disparage his skills).

    I also recommended the WIZ110SR which is equally simple to work with. Their documentation should be more than adequate although, again, there are no PIC code examples. It will, however, require you to make the TCP or UDP connections in your PIC code but there was a recent example of SNTP (using a different adapter) on this forum from Charles Linquis.

    None of the manufacturers of simple ethernet/serial adapters are likely to offer any microcontroller example code - it would take too much time and effort (and handholding) to provide examples for even the 4-5 most popular microcontrollers.

    I spent most of the past 10 months hospitalized and/or recovering from major surgery so I haven't been active on the forum. In my absence there have been some developments.

    Tibbo has finally released a replacement for their discontinued modules. Their USA distributor has been stocking it for a few months now. The EM500 is programmable in Tibbo's Basic dialect and they have several examples for SMTP (email), SNTP (time), HTTP (web server) on Tibbo's web site. You can also purchase direct from Tibbo for under $40. One caveat - It has 22 pins in a 2x11x0.050inch spacing and it needs an RJ45+magnetics (available from Tibbo and dealers) so you cannot breadboard it. Also, it's a 3.3V device but all the pins you need are 5V tolerant. You will need pull-ups on outputs if using a 5V PIC. Their online documentation is complete but requires a lot of hipping and hopping - old geezers like me prefer more linear arrangements. They do have an $85 evaluation board which includes everything you need and also illustrates an ingenious method of designing a PCB that allows plugging in the EM500 instead of soldering the closely spaced pins. It has a lot of flash memory available (320KB IIRC) for user programs. On the PIC end, code would be quite similar (but simpler) to mackrackit's example.

    Also, Mouser still has a "may need an export license" disclaimer on all of the ConnectOne devices. I don't know whether that means they won't ship overseas or whether it means they are selective about where they will ship.
    Last edited by dhouston; - 11th November 2010 at 13:35. Reason: corrected spelling of mackrackit :-(

  12. #12
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Cool!

    Thanks a lot Dave.

    I'll give that module a go...and see
    Roger

  13. #13
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    A couple of things about the ConnectOne.
    The pins spacings are metric
    if you plan to use it as a web page server it only does port 80.

    Other than that it is a good part. I have six in use currently.
    Dave
    Always wear safety glasses while programming.

  14. #14
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by mackrackit View Post
    A couple of things about the ConnectOne.
    The pins spacings are metric
    if you plan to use it as a web page server it only does port 80.

    Other than that it is a good part. I have six in use currently.
    The WIZ110SR is easier to interface as it has a DB9 on one end and an RJ45 on the other and comes with a power supply. But, it requires more coding from the PIC side. I'll leave it to those interested to study the docs to understand the differences.

    If you have an existing serial device you want to connect to the network, the WIZ110SR is the best choice. If you are designing a PCB and planning some quantity, ConnectOne (or Tibbo) is the way to go. Tibbo requires a lot of coding but they give you examples and 320K of flash to use with it. Your PIC app would probably be the simplest as the Tibbo could handle all of the heavy lifting network-wise.

    One additional point in favor of Tibbo. They have a GA1000 WiFi card (802.11b/g) that connects to the EM500 via SPI. At this point they haven't released EM500 firmware to support it but they indicate it is in their plans. Some of their other modules already support it. I think it's a little cleaner than the way ConnectOne does it - mackrackit may convince you otherwise.
    Last edited by dhouston; - 11th November 2010 at 20:17.

  15. #15
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Quote Originally Posted by dhouston View Post
    mackrackit may convince you otherwise.
    Nope, I am not stuck on one brand, from what you tell about Tibbo I will most likely try one for the next project.
    Dave
    Always wear safety glasses while programming.

  16. #16
    Join Date
    Dec 2005
    Posts
    1,073

    Smile

    Quote Originally Posted by mackrackit View Post
    Nope, I am not stuck on one brand, from what you tell about Tibbo I will most likely try one for the next project.
    Buy the evaluation board for your first one. Otherwise, you'll need to design a pcb due to the 2x11x0.050inch pinout.

    If you refer back to my first mention of them in this thread, you might wonder what changed my mind.

    I had 100 boards (designed to use their EM202) partially assembled and placed an order (with Crownhill) for 25 of the Tibbo modules only to learn, after a couple of weeks, that Tibbo would not allow dealers to sell them to the USA. I had earlier bough a handful from another dealer that I had used for prototyping. Shortly thereafter they discontinued it. The marketing gal in Taiwan that I communicated with promised a replacement in a few months. That stretched into about two years. Still, the EM500 has convinced me to forgive (but not forget) - it really is a neat design.

    I suspect they ran into patent issues with the earlier design which was in a single package similar to the Lantronix XPort.

  17. #17
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default

    I have you beat. I have over 1900 XPorts and 380 MatchPorts in the field. All connected to PICs.
    Charles Linquist

  18. #18
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default

    Lantronix XPorts aren't the easiest things to use, but if you decide to use them, I can give you a lot of help.
    Charles Linquist

  19. #19
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by Charles Linquis View Post
    I have you beat. I have over 1900 XPorts and 380 MatchPorts in the field. All connected to PICs.
    My projects are not intended for profit. They are mostly for my own amusement. It probably would not be amusing if I had to support 2280 units.

  20. #20
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default

    Quote Originally Posted by dhouston View Post
    My projects are not intended for profit. They are mostly for my own amusement. It probably would not be amusing if I had to support 2280 units.
    You are right! Supporting them isn't easy. Fortunately, they are in the hands of only 20-30 customers. That helps a bit.
    Charles Linquist

  21. #21
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default NANO module model and software or no-software?

    Quote Originally Posted by mackrackit View Post
    ...pins spacings are metric...it only does port 80...
    Thanks for the tips although I currently don't understand the importance of the port number

    I'm a little confused about which ConnectOne NANO module I need to order. Is it correct to choose part iL-SM2144H-I if I just need a module with pins, no WiFi, a RJ45 socket onboard? But then it is a Nano SocketLAN I want to buy not the Nano LANReach or am I wrong?

    One more question about the NANO module; as I will use it to update a server's clock using NTP (or SNTP), will I need an external program running on the server to handle the time information provided by the module or is the module capable to do it all by itself?

    According to Dave's post, the WIT110SR module could also be an option (http://www.wiznet.co.kr/Sub_Modules/...te3=0&pid=1040) but, at a first glance, it looks a little more complicated however it is half the price of the Nano (!).

    BTW, I just found ConnectOne's LAN modules comparision chart here here.
    Roger

  22. #22
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Thanks for the tips although I currently don't understand the importance of the port number
    If you have one of these modules behind a router (NAT) and another device is configured for PORT 80, say Apache for a web sever, you will not be able to serve web pages directly from the module because it only listens on PORT 80 and this can not be changed. Same if you have it set as a HTPPS server, PORT 443 is all it will listen to. This all is not a problem on a LAN.

    The SERIAL NET function of these modules are not a problem, you can pick your port.
    But then it is a Nano SocketLAN I want to buy not the Nano LANReach or am I wrong?
    The Nano Socket family are the ones I use, they have pins. The on board antenna on the wifi module is pretty good too.

    One more question about the NANO module; as I will use it to update a server's clock using NTP (or SNTP), will I need an external program running on the server to handle the time information provided by the module or is the module capable to do it all by itself?
    I am not sure how to answer this one.
    The module can be set to check certain time servers, it is a client.
    From your other thread I think I know what you want to do. Have your own time server on a LAN that is not connected to a WAN?
    If that is correct then I think it is doable...
    Where ever you are getting your time from could be sent to the module with a PIC and the module FTP, SERIAL NET, email,,, the data to the server. Then the server has a script to deal with the data... Kind of like I do for temperature data??
    Dave
    Always wear safety glasses while programming.

  23. #23
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    I bought one of the modules with the itsy-bitsy socket because I wanted to see whether it was practical to incorporate it in by PCB design. I decided against it but the boards themselves were the same so I just added pins in order to use that first one in prototyping. One advantage of adding the pins myself was I could mount it atop or beneath my main PCB. BTW, the support techs at ConnectOne are very sharp and well orgaized - all my questions were answered by the same tech so there was no loss of continuity. (Either they are well organized or they only have one overworked support tech.)

    I know there are ways to push the time out to machines on a LAN but, as I've never had the need, I've never explored it. Search Bing (or Google?) using Time Synchronization Network (LAN) for details.

  24. #24
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default

    Quote Originally Posted by mackrackit
    From your other thread I think I know what you want to do. Have your own time server on a LAN that is not connected to a WAN?
    Yes, correct.


    Quote Originally Posted by mackrackit
    Kind of like I do for temperature data??
    No, just accurate time & date from a radio-controlled system (in Europe, it is DCF77 from GERMANY) or GPS module.


    Quote Originally Posted by dhouston
    ...if you are looking at a one-off design, it is ready to go out-of-the-box with no assembly required
    Yup, it's a one-shot project. Anyway, I need to design a PCB for the PIC and the DCF77 receiver. But your points are pertinent...and you make me doubt about the best choice I have to go for

    Let's do it a feminine way: keep the first impression as beeing the best one = NANO!
    Roger

  25. #25
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by flotulopex View Post
    According to Dave's post, the WIT110SR module could also be an option (http://www.wiznet.co.kr/Sub_Modules/...te3=0&pid=1040) but, at a first glance, it looks a little more complicated however it is half the price of the Nano (!).
    As I noted above, of the three (ConnectOne, Tibbo, WIZNet), the WIZ110SR will require the most coding on the PIC end but, if you are looking at a one-off design, it is ready to go out-of-the-box with no assembly required.

    If you are planning for volume and designing a PCB, I would go with ConnectOne or Tibbo and the choice would probably depend on the application. The Tibbo, with its own program memory offloads nearly all of the network coding but does mean you are working with two different Basic dialects. I think, if you study the docs I've referenced, you'll be most impressed with the Tibbo. I design projects that usually have some DIY elements and the flexibility of the Tibbo and the fact it is programmable in Basic make it attractive in that environment. Plus, users can reprogram as needed if I become totally incapacitated.

    BTW, when I bought my ConnectOne modules they had not released the SocketLAN so I added my own pins to the LANReach. I tend to use the latter term to apply to either.
    Last edited by dhouston; - 12th November 2010 at 12:28.

  26. #26
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Here are some additional links.

    Charles Linquis PIC code to get network time...http://www.picbasic.co.uk/forum/show...k+time+charles

    Tibbo's example code to get network time...http://basic.tibbo.com/resources/web/internet_time.html

    You should be able to compare and contrast those and learn a bit that you can then transfer to either the ConnectOne or WIZNet devices.

    Here's Tibbo's other examples...http://basic.tibbo.com/resources.html

    Once you grasp that Tibbo uses an object oriented Basic dialect, it should be fairly simple to convert the code to a PIC.

    I would share my PIC code but the truth is I have none. I use mostly 8-pin PICs for small special single-purpose applications. Most then link serially to a ZBasic chip which I find much easier to work with for complex problems. I'm an old geezer (69) with major health issues who has neither time nor desire to become an ASM wizard like Darrel Taylor (much, much younger) or Bruce Reynolds (also much younger) so I prefer a chip that has two hardware serial ports plus 4 software serial ports all of which are buffered, full-duplex and operate in the background as well as numerous other features of similar power (that would require Darrel or Bruce to duplicate with PBP) for major projects. Plus, my ZBasic code is proprietary.
    Last edited by dhouston; - 11th November 2010 at 19:34.

Similar Threads

  1. PIC and TCP/IP
    By jscoulter in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th September 2009, 11:21
  2. PIC 18F97J60 and Ethernet
    By mikebar in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th April 2008, 12:51
  3. Ethernet <> PIC link
    By The Master in forum Off Topic
    Replies: 9
    Last Post: - 16th November 2007, 12:04
  4. Adding a pic in I2C network....
    By robert0 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2005, 12:07
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 1

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