Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)


Closed Thread
Results 1 to 40 of 63

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Henrik, Bravo!

    Robert

  2. #2
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hey Henrik (and others),
    I just received my Amicus18 and the Arduino Ethernet Shield...

    I have not completed the modifications yet... but am starting that tonight.

    I assume your example code is intended to overwrite the Amicus boot loader? (I did read the amicus with my PicKit2 and save the hex file, so I think I can go back to the boot loader if I want.)

    How has your progress been?? Where are you hoping to go with your experiments?

    I would like to end up with a device that...
    I can log into and read or view values like temperature, voltage status bits etc.
    That could possible email me or text me if a given value changes beyond a set point.
    Be able to remotely change values and bits.
    ?? other things yet un thought up.

    I do not have any experience programing ethernet values via a PIC.

    I have plenty of experience Pinging... seting static IP... subnet mask... Telnet... etc. From a Windows XP machine.

    Thanks for any help, direction and code examples you (and others) can give.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Henrik,

    My Amicus board came with a 18F25K20 NOT the 18F25K22 that you mention in your article. I see the difference is 3.3v vs 5v. Am I going to need to get the K22 chip?

    Thanks
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hi Dwight,
    Wonderful, please join the fun!

    No, I wrote 25K22 in error, it's meant to say 25K20 so you're fine - just use the AMICUS18 as it is. (You CAN definitely use the 25K22 if you want but I think you'd need to run it on 3.3V, I don't remember if the W5100 has 5V tolerant inputs). I'd like to stress, again, that you don't need an AMICUS18 at all, the routines will work with ANY PIC that has a MSSP module.

    No, don't overwrite/replace the bootloader. Add DEFINE LOADER_USED 1 at the top and set MCSP (or whatever you use) up to use the AMICUS Loader. It'll be a lot faster than re-flashing with the PicKit2.

    Progress is good but a bit slow. This is all new territory for me, researching protocols, reading RFC's, trying, failing, trying again.

    The goal is basically a set of routines, lets call it a "framework", which you can use to build the application you need. It won't do everything but it'll provide the base functionallity upon which we can write the actual application. At the moment I have the basic routines used to communicate with the W5100 and a couple of support routines to make using sockets and moving data in and out of easier. This is allready presented and published in the thread.

    I have DHCP (Dynamic Host Configuration Protocol) working - also presented in the thread.
    I have SNTP (Simple Net Time Protocol) working, (derived from Charles really accurate clock code but without using LONGs)
    I have SMTP (Simple Mail Transfer Protocol) (with authentication) basically working (it sends mails) but it needs more work to increase the robustness and improve the interface to the main application.

    When I'm happy with the SMTP code I think I'll take on DNS and if/when that works I think I'll try to make some kind of HTTP server "building block" but I'm not sure it'll work since each and every application will be different. Perhaps it's just better to write that from scratch - I don't know. The biggest hurdle, as I see it, is how to handle a "filesystem" of some sort on the PIC. A single, very simple web-page is not a problem but it gets complicated when you want multiple pages, perhaps images etc. Actually storing them (SD-card, SPI-flash, I2C-EEPROM whatever) is one part, keeping track of them (ie. the filesystem) is another and how to get them INTO the memory device is a third.

    The application you envision is pretty much what I had in mind when I started but I'm trying to write the code as generic as possible. That way you can included the functionallity you need and leave the rest out. With the code and examples already presented you should be able to get DHCP and a simple web-server going. Perhaps you'll get a general HTTP server building block going before I get to it.

    Keep us posted on your progress!

    /Henrik.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hi,
    Just thought I'd give those with interest in this project a short update of what I've been doing.

    Take a look at the following screenshot:

    Name:  W5100_Test.jpg
Views: 7535
Size:  124.8 KB

    The screenshot itself is pretty self explainatory but I'll do a short explanation of what is happening (it's quite a bit).

    At bootup the DHCP code is executed to retrieve the network parameters from the DHCP server, then the W5100 is configured with those parameters. Then the SNTP code is executed to retrieve current time from an SNTP server on the net. Then a series of DNS queries are run, looking up the IP-adress of some well known URL's. The last URL that DNS queries is the SMTP server for my email account. Once it gets that IP-adress it uses it in the SMTP code to login to my account, using authentication (no encryption just AUTH LOGIN (BASE64 encoded username and password)), and sends an email to my account - which you can see next to the serial terminal.


    There is one thing I don't get though. Browsing to to the IP-adress retrieved by the DNS code gets me to the correct places in all but ONE instances, namely THIS SITE. If I PING www.picbasic.co.uk I get the same IP as my DNS code and if I run Wireshark and browse to www.picbasic.co.uk its DNS-records shows the same IP-adress but if I browse to that very same IP I do not end up here. I'm pretty sure it's not an error in my code since every other URL I've tried seems to work. It has to be something specific with where and how this site is hosted. Anyone know, and can explain, what's going on?

    Anyway the DNS code currently "only" handles normal queries, not reversed or any other type, like MX etc. It does handle both direct type A responses and CNAME responses, either single or "nested". For example, the query for microsoft results in a response with no less than three CNAME records (aliases) before finally arriving at the IP-adress shown.

    That's it, just wanted to show you what's going on at my end. If anyone else is doing anything cool, please tell!

    /Henrik.
    Last edited by HenrikOlsson; - 25th October 2011 at 19:19.

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

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    It has to be something specific with where and how this site is hosted. Anyone know, and can explain, what's going on?
    Shared/virtual machine/site.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Feb 2011
    Location
    South Carolina, USA
    Posts
    7

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Henrik, have you been able to work on this project any more?

    john

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hi John,
    Yes, a little bit. I've been working on external SPI flash routines for storing HTML-data and use "dynamic variables" in the HTML. This now works fairly well and I'm working on a way to use MPFS2 images. As it stands I can read the FAT table and access the files alright but I'm trying to figure out the correct/best way to have more than one file open at a time. I tend to be a bit (perhaps a bit too) conservative when it comes to using RAM and I try to make the most out of it. Having multiple file "open" seems to be quite a hog in that respect but perhaps I'll just have to accept that and just get it working.

    (It would be nice to have proper functions and local variables in PBP)

    Is there anything in particular you're trying/want to do or thinking about?

    /Henrik.

Members who have read this thread : 0

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