View previous topic :: View next topic |
Author |
Message |
jeftab
Joined: 10 Feb 2011 Posts: 10
|
ethernet 28j60 |
Posted: Thu Feb 10, 2011 9:51 am |
|
|
Hi I am working on a project with the 18f4620 and the 28j60 ethernet controller.
My HTML web page need to be refreshed when an input value is changed only, so I am not really interested in the automatic meta refresh. Anyone got any idea how can I do it ? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Feb 10, 2011 10:54 pm |
|
|
Look at the free Microchip Application Library's TCPIP App Demo example...
It's a different mechanism than the meta 'refresh' tag.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Mon Feb 14, 2011 8:20 am |
|
|
Thanks for your answer, but if you're talking about the an833 application note, I couldnt find anything ... |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon Feb 14, 2011 10:18 am |
|
|
No.
I'm talking about the TCPIP App Demo where they use javascript/ajax to auto-refresh variables...
I'm actually writing a control app in a web page with that source as an example. Initially, they have a 10mS timer ... but 100times a second is more than I want. I'll probably bump it down to 5times a second..
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Mon Feb 14, 2011 10:33 am |
|
|
Do you mind sharing some examples? I'm not really familiar with ajax. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon Feb 14, 2011 10:45 am |
|
|
No need for me to share.
It's in the Microchip applications library.
I think the latest install still goes in:
C:\Microchip Solutions v2010-10-19\
Then go to TCPIP Demo App\WebPages2
look at index.htm, mchp.js, status.xml -- it's all in there.
Cheers,
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Mon Feb 14, 2011 10:49 am |
|
|
Thanks mate, I'll take a look. |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Tue Feb 15, 2011 12:42 pm |
|
|
allright , after some hours spending, I've figured out that ccs won't be enough for me, and I'll have to use the c30.
Am I right or wrong ? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Feb 15, 2011 1:00 pm |
|
|
It depends...
You haven't told us anything else about what you're doing.. and my crystal ball is down for maintenance this week.
I'm working on a web page now that will have plenty of time to refresh every 200mS with all the things it's doing.
-Ben
BTW, there is a version of CCS for PIC24/dsPIC devices. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Tue Feb 15, 2011 1:08 pm |
|
|
Allright, I'll explain my project,
I am a final year student, and my project is based on house or commerial domotics, so I'll have a few smoke, gaz, movement sensor, alarm, heating system controls from a single webpage.
I am using a pic 18f4620 with the ethernet module 28j60.
My code is all set up, my only problem is the webpage and its refreshing speed, it need to be reliable ... |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Feb 15, 2011 1:15 pm |
|
|
How fast does your application need to update? 1000 times per second? Or on value change (since that's really not how HTTP works... )?
HTTP is about a server responding to requests.. not openly sitting with a socket waiting to receive data from a PIC (or anything else for that matter) unless you write a Java application that runs inside the browser window that keeps an open connection to the PIC to allow updates.
And, I hate to say it - But Ethernet is intrinsically non-deterministic.
The network will try its best to deliver packets in a timely manner, but can never be guaranteed.
If your application has reliability as a requirement, you need to really dig in to determine backup methods for "always up" services.
Try getting your hands on a PICdem.net2 and run the demo application.. depending on all the stuff your doing... you may be surprised.
It will also give you a better idea of how things are working. (although you can look at the code that exists now). _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Tue Feb 15, 2011 1:27 pm |
|
|
Thanks for your help mate, but the best for my project would be a refresh on value change, is there any way to do it with ccs ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Tue Feb 15, 2011 1:33 pm |
|
|
Update rate can be as slow as 4 times a second for alarms and HVAC controls.
FYI: The absolute best, 'state of the art' commercial ULC double A graded alarm systems back 15-30 years ago were this 'fast'. These systems were used in banks, furriers, diamond stores, etc. Even today, their signalling technology cannot be beat by any wireless or wired (ethernet, FO, nternet etc) system. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Feb 15, 2011 1:41 pm |
|
|
temtronic wrote: | Update rate can be as slow as 4 times a second for alarms and HVAC controls.
FYI: The absolute best, 'state of the art' commercial ULC double A graded alarm systems back 15-30 years ago were this 'fast'. These systems were used in banks, furriers, diamond stores, etc. Even today, their signalling technology cannot be beat by any wireless or wired (ethernet, FO, nternet etc) system. |
And he's right - You need dedicated communications...
So let's say ethernet will suffice,
because HTTP doesn't work the way you want (it's essentially polled and ajax/javascript just changes the polling from a user click on "reload" to a software based reload), what you need is a web page that loads a java app that connects to a socket on the PIC...
Then while the socket is open, any time the value changes, a message is sent to any listening client.
Yes. that could easily be done on a PIC.
I particularly like the PIC18F97j60... so try that instead of the 2chip approach.
With CCS or C18 would work.
Cheers,
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
jeftab
Joined: 10 Feb 2011 Posts: 10
|
|
Posted: Tue Feb 15, 2011 1:53 pm |
|
|
PIC18F97j60 wow now that something interesting ! hmm I am so familiar with the 18f4620, I am afraid its going to take me a while in order to figure out the whole files and drivers needed for ccs and everything ...
i am not really familiar with all that tcp and networking part... |
|
|
|