Right now i have PIC18LF2520. I have interfaced ENC28J60 with micro-controller. Power supply +3.3V. And I have connected 1 LED to microcontroller pin.
Good news is voltage level translation is no longer a concern, the bad news the PIC18LF2520 has relatively limited Flash/RAM resources to implement a TCP/IP stack.
I want to control that LED from the internet. How to do that? How to configure microchip application libraries for my purpose?
Well, essentially you have a few choices:
1. You study the datasheet and along with your advanced knowledge of TCP/IP, you write your own ENC28J60 Library/API.
2. Find an existing ENC28J60 Library/API with source code and port it to the PIC18LF2520 if required.
3. You download and install Microchip's TCP/IP stack, modify it to accommodate the relatively limited Flash/RAM resources of the PIC18LF2520.
4. Find examples of the Microchip's TCP/IP stack which has already been modified for a PIC which has similar limited Flash/RAM resources as that of the PIC18LF2520.
Olimex at one time offered a PIC-MINI-WEB development board which utilized the PIC18F25J10 which has 32KB Flash and 1KB RAM, even less RAM than the PIC18LF2520.
They also modified the Microchip's TCP/IP stack to accommodate the limited resources of the PIC18F25J10 and offer it for free download:
Olimex PIC-MINI-WEB
PIC-MINI-WEB is with dimensions of only 55 x 36 mm, but don't let this to fool you. This board is very powerful and will allow you to connect almost everything to the Internet. The board has a PIC18F25J10 microcontroller with 32KB of program Flash memory, 1024 RAM memory and allow Microchip free TCP-IP stack to be programmed. In addition on board flash of 1 Mbit (128KB) is available as data storage for web pages etc info. The LAN connector could be connected to 10 a Mbit Etherent switch or hub. There is also an IDC14 connector with 10 GPIOs available for future extensions and a power supply and reset signals. What can you do with this board? You name it: you can setup a web server with dynamic web pages which allow you to read PIC resources or to drive them through web interface, i.e. to read ADC and display it on the web or to toggle GPIO outputs from the web, a very convenient way to make home automation for instance and to monitor and control your home from anywhere with Internet. Another service this board can run is a FTP server, or you can control the PIC by Telnet, or you can send and receive e-mails and trigger hardware events with them. All this is possible thanks to the free firmware which Microchip provide, and the best of it all is that it has no upfront charges for software nor royalties.
From the above description, you should be able to port the demo code to the PIC18LF2520 and control the LED as desired.
The product also offers the schematics of their PIC-MINI-WEB dev board, which might be handy.
BigDog