View previous topic :: View next topic |
Author |
Message |
hoerspieler
Joined: 17 May 2008 Posts: 3
|
Posted: Thu Dec 18, 2008 10:36 am Post subject: ENC28J60 and newer Bascom-versions... |
|
|
Hi,
to get it to work with Bascom 1.11.9.2 I changed the following in Ben's code:
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 0
changed into
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 1
and in the Sub Enc28j60readcontrolregbyte I changed
If Mcphy = 1 Then
Enc28j60_data = A(2)
Else
Enc28j60_data = A(3)
End If
into
If Mcphy = 1 Then
Enc28j60_data = A(2)
Else
Enc28j60_data = A(1)
End If
Perhaps you can try this. I think the older Bascom versions have had a bug in handling of the spi.
Regards, |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Thu Dec 18, 2008 1:30 pm Post subject: A big THANKS |
|
|
Thanks for fixing that.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
pashe007
Joined: 28 Dec 2006 Posts: 7
|
Posted: Sat Dec 20, 2008 10:20 am Post subject: |
|
|
thank you for your code.
i try this code for my ethernet device.
is code work at bascom 1.11.9.0 ? |
|
Back to top |
|
|
pashe007
Joined: 28 Dec 2006 Posts: 7
|
Posted: Sun Dec 21, 2008 4:40 am Post subject: |
|
|
thank you ben .
your code is very good & working on my circuit.
i have one litile bug in my circuit .
best regard |
|
Back to top |
|
|
huetti
Joined: 25 Feb 2007 Posts: 9
|
Posted: Sun Dec 28, 2008 8:59 pm Post subject: |
|
|
@hoerspieler
Hi
versuche gerade das pollin-board als Webserver zum laufen zu
bringen. Mit deinen Änderungen geht das ping-reply einwandfrei.
http geht nicht, UDP mangels Zeit noch nicht geprüft.
Geht bei dir die Ausgabe von http-Seiten ?
Grüße
Hütti |
|
Back to top |
|
|
Ajaxelectronic
Joined: 22 Nov 2009 Posts: 171 Location: Iran
|
Posted: Thu Apr 03, 2014 10:44 pm Post subject: |
|
|
Hi
first tanks to Ben for nice code and subroutines. i make a circuit with atmega32 and it work nice. i could send and receive data in TCP mode.now i want 2 question!
1. how can i read from AVR every 10 second?
now i can read my PORT or ADC data with SUBMIT button. but i want to reading be automatic. for example every 10 second. i test several ways,but i can't get a result.
2. how can i connect to my board from the internet?
now i can connect to my board in the local area network,but i can't connect to it from the internet.
Best Regards _________________ www.mrkelectronic.blogfa.com
Best Regards |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Fri Apr 04, 2014 3:01 am Post subject: |
|
|
Hello Ajaxelectronic
If you look at the blog section you will find my ENC28J60 webserver project this has a lot of information in the comments.
There is a problem with internet explorer and the ENC28J60 I have two projects one with a DsPIC33 and the AVR both have the problem but have totaly diffrent code so you are better to use firefox or chrome. Now the DsPIC33 project is called Webserver In a Box (WIB) by silicon chip magazine in australia and it uses Ajax code to poll the little server to get the ADC and digital readings from it updating on the page using a timer this could be changed to work with the AVR but not used in a comercial project due to copyright , though it will show how to use java script then you can write your own java script. I have been working on an Arduino board with the Wiznet W5100 moving the code over to use it as I met a dead end with the ENC28J60 not being able to send multiple packets which the Wiznet chip can as it does all the TCPIP work and will publish it in the Blog section when I get it stable and working properly.
Regards Paul |
|
Back to top |
|
|
Ajaxelectronic
Joined: 22 Nov 2009 Posts: 171 Location: Iran
|
Posted: Fri Apr 04, 2014 9:00 am Post subject: |
|
|
thanks a lot Paulvk
i saw your project and iframe code and RestartJava. i used from a little HTML code that can refresh my page every 10 second (NOTE, refresh time is changeable easily).
but i can't understand how can i connect to my board from internet. for example my board is in the my home and i am i my little office in the other city.how can i connect to my board ,now?
Best Regards _________________ www.mrkelectronic.blogfa.com
Best Regards |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Fri Apr 04, 2014 9:45 am Post subject: |
|
|
You will have to do port forwarding in you internet modem/router but this will expose it to the net, the best way is with Virtual Private Network (VPN) for this you need a VPN server where the unit is, this enables you to use a username and password to log into your network and make as if you are connected at home it also hides what you do using encryption. Some modem/routers have this built in or you need a small computer on your network to run the server so do some research on port forwarding And VPN.
Regards Paul |
|
Back to top |
|
|
Ajaxelectronic
Joined: 22 Nov 2009 Posts: 171 Location: Iran
|
Posted: Fri Apr 04, 2014 10:26 am Post subject: |
|
|
ok. i search about it.
what is your idea about Valid IP ? is it possible? _________________ www.mrkelectronic.blogfa.com
Best Regards |
|
Back to top |
|
|
whoman
Joined: 25 Jul 2014 Posts: 2
|
Posted: Fri Jul 25, 2014 12:34 pm Post subject: hi Mr BEN |
|
|
hi
im going to simulate a enc28j60 and atmega in proteus
(in help of proteus says we can this in real networke or...)
im reed your code in
http://members.home.nl/bzijlstra/software/examples/enc28j60.htm
and i really mixed up hardly for you sub and i cant understand :
Sub Enc28j60selectbank(bank As Byte)
'get ECON1 (BSEL1 en BSEL0)
A(1) = &B000_11111
Enc28j60_cs = 0
Spiout A(1) , 1
Spiin A(1) , 2
Enc28j60_cs = 1
A(2) = A(2) And &B1111_1100 'strip bank part
A(2) = A(2) Or Bank
A(1) = &B010_11111
Enc28j60_cs = 0
Spiout A(1) , 2
Enc28j60_cs = 1
End Sub
A(1) will contain the dummybyte, so in A(2) the value of register ECON1. We strip BSEL1 and BSEL0 bits, put in the bank we want to switch to, and send the result back to the ENC28J60. The instruction for a write control register is &B010 followed by the register we want to write.
when A(2) = A(2) And &B1111_1100
A(2) = A(2) Or Bank
who A(2) the value of register ECON1 ??????????????????????????????????????????????????
u spiin A(1) and
A(2) = A(2) And &B1111_1100
A(2) = A(2) Or Bank
then say A(2) a value of econ1 !!!!!!!!!!!!!!!!
plz help me
AND I HAVE ONE REQUEST FOR U MR BEN PLZ PLZ ATTACH ME A SIMPLE AND EASY PROGRAM OF THIS CODE FOR ME IM REALLY TIERD TO UNDERSTAN THIS CODE
best regurad for u and have fun |
|
Back to top |
|
|
whoman
Joined: 25 Jul 2014 Posts: 2
|
Posted: Mon Jul 28, 2014 8:29 am Post subject: |
|
|
this simulate is done if every one need help im ready |
|
Back to top |
|
|
Debu
Joined: 06 Jan 2008 Posts: 21 Location: Dhaka
|
Posted: Thu Aug 21, 2014 12:36 pm Post subject: |
|
|
Hallo
Ben
Do you try this code in Xmega ? |
|
Back to top |
|
|
|