ENC28J60 Ethernet Library V3.3
ENC28J60 Ethernet Library V3.3
Finally ... done library for ENC28J60
This library is in test, please test this library !
Library is OPEN SOURCE and with small modifications must work on DSPIC MCU and ATMEL MCU. Of course I will make this modifications !
Project compiled for BIGPIC4 board, MCU PIC18F8722.
ENC28J60 CS pin PORTC.1
ENC28J60 RESET pin PORTC.0
Default Ip : 192.168.1.253
You can download source code from : http://www.microelemente.ro/MikroPascal ... source.zip
Live software :
http://ip-watcher.dyndns.info/
http://ip-watcher.dyndns.info/page1
This library is in test, please test this library !
Library is OPEN SOURCE and with small modifications must work on DSPIC MCU and ATMEL MCU. Of course I will make this modifications !
Project compiled for BIGPIC4 board, MCU PIC18F8722.
ENC28J60 CS pin PORTC.1
ENC28J60 RESET pin PORTC.0
Default Ip : 192.168.1.253
You can download source code from : http://www.microelemente.ro/MikroPascal ... source.zip
Live software :
http://ip-watcher.dyndns.info/
http://ip-watcher.dyndns.info/page1
Last edited by yo2lio on 04 Feb 2008 22:35, edited 1 time in total.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Library updated !
Resolved small BUG in CopyEthMemToEthMem routine. When length of data copy was 0 or 1, MCU frozen.
This BUG was submitted by guyfoc.
Resolved small BUG in CopyEthMemToEthMem routine. When length of data copy was 0 or 1, MCU frozen.
This BUG was submitted by guyfoc.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Yes it's possible, unfortunately I don't have time for this, now I must make some money !kayh wrote:yo2lio, do you think it is possible to add DHCP to your library? I'm no expert in this, but it would be nice to automatically get a proper IP when connecting to an unknown switch/network.
Library is OPEN SOURCE , if you want you can try to implement DHCP.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Hi,
Library updated. Resolved small bug in Get_Time routine.
Renamed all ENC28J60 registers (in unit definitions_ENC).
Added 4 new procedures Eth_SetBank_0, Eth_SetBank_1, Eth_SetBank_2, Eth_SetBank_3, instead of Eth_SetBank(x).
You can download source code from : http://www.microelemente.ro/MikroPascal ... source.zip
Old files : http://www.microelemente.ro/MikroPascal ... ce_old.zip
Library updated. Resolved small bug in Get_Time routine.
Renamed all ENC28J60 registers (in unit definitions_ENC).
Added 4 new procedures Eth_SetBank_0, Eth_SetBank_1, Eth_SetBank_2, Eth_SetBank_3, instead of Eth_SetBank(x).
You can download source code from : http://www.microelemente.ro/MikroPascal ... source.zip
Old files : http://www.microelemente.ro/MikroPascal ... ce_old.zip
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Example for PIC18F8722 needed
Dear Yolio,
appreciate if you can provide a working example for PIC18F8722.
As you said the library is tested BIGPIC4 board, MCU PIC18F8722.
but I can not find the example. all the example are for 18F87J60
I need to get it working on 18F4620
Thanks
appreciate if you can provide a working example for PIC18F8722.
As you said the library is tested BIGPIC4 board, MCU PIC18F8722.
but I can not find the example. all the example are for 18F87J60
I need to get it working on 18F4620
Thanks
Re: Example for PIC18F8722 needed
Hi,Georges wrote:Dear Yolio,
appreciate if you can provide a working example for PIC18F8722.
As you said the library is tested BIGPIC4 board, MCU PIC18F8722.
but I can not find the example. all the example are for 18F87J60
I need to get it working on 18F4620
Thanks
Unfortunately I don't have examples in MikroPascal.
You can download examples only in MikroBasic language :
http://www.microelemente.ro/MikroBasic/ ... amples.zip
Sorry.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Great Library YOLIO. I converted the BASIC example Mini Web Server to mMikroPascal.
I have it runing great in PROTEUS simulator and VMWARE.
I Have a question yet : Do you have an example where I can use a web page to turn on/off a pin on porta or any other led.
The example says that only get method is implemented.
thanks.
I have it runing great in PROTEUS simulator and VMWARE.
I Have a question yet : Do you have an example where I can use a web page to turn on/off a pin on porta or any other led.
The example says that only get method is implemented.
thanks.
Look at Brunos examples, all you do is intercept a get http://URL/pin1porta (or whatever you want to call it) and then toggle the pinGeorges wrote:Great Library YOLIO. I converted the BASIC example Mini Web Server to mMikroPascal.
I have it runing great in PROTEUS simulator and VMWARE.
I Have a question yet : Do you have an example where I can use a web page to turn on/off a pin on porta or any other led.
The example says that only get method is implemented.
thanks.
Done, Pin control is completed.
Three questions:
1- can I use POST instead of GET method. if yes how ?
2- The MCU sometimes freezes, after 2-3 hours even if left without pings or any thing else. Do you know of any special considerations?
3- what is the difference between eth_ip_addr and user_ip_addr ?
4 what will happen if I don't call countertask every 1ms. what is the role of countertask. will i loose tcp connection if I don't call it?
thanks.
Three questions:
1- can I use POST instead of GET method. if yes how ?
2- The MCU sometimes freezes, after 2-3 hours even if left without pings or any thing else. Do you know of any special considerations?
3- what is the difference between eth_ip_addr and user_ip_addr ?
4 what will happen if I don't call countertask every 1ms. what is the role of countertask. will i loose tcp connection if I don't call it?
thanks.
Yes you can. It's not so easy, you can do this only with Explores browser, you must search in packet after your parameters ....Georges wrote:1- can I use POST instead of GET method. if yes how ?
Code: Select all
// get 15 first bytes only of the request, the rest does not matter here
for i := 0 to 14 do getRequest[i] := Eth_GetByte;
httpMethod1 := 'Get /';
httpMethod2 := 'Post /';
if memcmp(@getRequest, @httpMethod1, 5)<>0 then goto get_meth
else if memcmp(@getRequest, @httpMethod2, 6)<>0 then goto post_meth
else
begin
result := 0 ;
exit;
end;
get_meth:
post_meth:
I don't know why ...Georges wrote:2- The MCU sometimes freezes, after 2-3 hours even if left without pings or any thing else. Do you know of any special considerations?
user_ip_addr is not used by library , is used only in example, also you can use this variable in your applications, if you wantGeorges wrote:3- what is the difference between eth_ip_addr and user_ip_addr ?
CounterTask is used by NTP (real time clock) and by ping stack.Georges wrote:4 what will happen if I don't call countertask every 1ms. what is the role of countertask. will i loose tcp connection if I don't call it?
You can skip this if you want.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
First, thank you.
Second:
I have integrated your code above. now the for uses the POST method. the problem now is that the form data being posted is not part of the URL anymore (good). But because of that, when the statement :for i := 0 to 20 do getRequest := Eth_GetByte; is executed, getRequest string does not include the data of the form.
May you please point me where to look for the form data in the incoming packet?
thank you
Second:
I have integrated your code above. now the for uses the POST method. the problem now is that the form data being posted is not part of the URL anymore (good). But because of that, when the statement :for i := 0 to 20 do getRequest := Eth_GetByte; is executed, getRequest string does not include the data of the form.
May you please point me where to look for the form data in the incoming packet?
thank you
Copy received packet in PIC memory :
And now search the string after your data ....
Code: Select all
var getRequest : string[1478]; // HTTP request buffer (max. 1478 , (1518 - 40) bytes)
...
for i := 0 to (len_T - 1) do getRequest[i] := Eth_GetByte;
getRequest[i] := 0;
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro