caramoan tour package

caramoan tour package

Author Topic: MikroC's SPI Ethernet ENC28J60 Library  (Read 9681 times)

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #40 on: May 09, 2012, 08:46:40 AM »
OT:
Sorry nawalan na naman ng net kagabi.
Installment basis lang po ito mga masters. ;D ;D ;D
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Philippine Electronics Forum

Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #40 on: May 09, 2012, 08:46:40 AM »

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #41 on: May 09, 2012, 08:50:24 AM »
First we need to save our HTML codes to our mcu's memory.
We could save it either to RAM or ROM memory.
The former is much faster but usually has lesser capacity (especially on PIC16 devices).
So usually sa ROM ito naka save.

Pag i-save natin ito sa ROM (we will save it as a constant) we do it this way,
Code: [Select]
const   char    *indexPage =   
"<meta http-equiv="refresh" content="3;url=http://192.168.20.60">
<HTML><HEAD></HEAD><BODY>
<h1>PIC   ENC28J60 Mini Web Server</h1>
<a href=/>Reload</a>
<script src=/s></script>
<table><tr><td valign=top><table border=1 style="font-size:20px ;font-family: terminal ;">
<tr><th colspan=2>ADC</th></tr>
<tr><td>AN2</td><td><script>document.write(AN2)</script></td></tr>
<tr><td>AN3</td><td><script>document.write(AN3)</script></tr></td></table>
This is HTTP request#<script>document.write(REQ)</script></BODY></HTML>
";
And to use it,
Code: [Select]
putConstString(indexPage);

Pag sa RAM naman,
Code: [Select]
char    *indexPage =               
"<meta http-equiv="refresh" content="3;url=http://192.168.20.60">
<HTML><HEAD></HEAD><BODY>
<h1>PIC   ENC28J60 Mini Web Server</h1>
<a href=/>Reload</a>
<script src=/s></script>
<table><tr><td valign=top><table border=1
style="font-size:20px ;font-family: terminal ;">
<tr><th colspan=2>ADC</th></tr>
<tr><td>AN2</td><td><script>document.write(AN2)</script></td></tr>
<tr><td>AN3</td><td><script>document.write(AN3)</script></tr></td></table>
This is HTTP request#<script>document.write(REQ)</script></BODY></HTML>
";
Again to use it,
Code: [Select]
putString(indexPage);

Everytime putString(indexPage) or putConstString(indexPage) is called, it stores the whole
strings (excluding null termination) inside the indexPage array in the above example,
into ENC28J60 RAM starting from current ENC28J60 write pointer (EWRPT) location.
It also returns the number of bytes written into ENC28J60 RAM.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Philippine Electronics Forum

Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #41 on: May 09, 2012, 08:50:24 AM »

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #42 on: May 09, 2012, 12:22:59 PM »
HTML is a way of describing how a set of text and images should be displayed to the viewer, similar in concept to a newspaper editor's markup symbols.

Let us dissect the HTML on the simple webserver example.

The "/" symbol tells the mikroC compiler it's the end of the line.

Code: [Select]
const   char    *indexPage =  Creating the "indexPage" array.
Everything in between the =" and "; is part of the "indexPage" array.

Code: [Select]
<meta http-equiv="refresh" content="3;url=http://192.168.20.60">It refreshes "http://192.168.20.60" for every 3 seconds.
Useful for updating the status of the ADC's.

Code: [Select]
<HTML><HEAD></HEAD><BODY>These are HTML tags.
It is enclosed in between <tagname> and  </tagname>.
We start the HTML code with <HTML> and ends (at the bottom) with </HTML>.
In the <HEAD></HEAD> tag we could put here other infos about our html for example the title to display above the browser.
We will write most of our HTML codes inside the <BODY> and </BODY>. It is just like the body of a letter.

Code: [Select]
<h1>PIC   ENC28J60 Mini Web Server</h1>It's self explanatory. ;D
From <h1> to <h6> can be used, decreasing in size.

Code: [Select]
<a href=/>Reload</a><a> </a> is a link tag.
The link it represent is written after the "href=".
In between the tag, "Reload" in this example, is rendered as the link the user can click on.

Code: [Select]
<script src=/s></script> Goes to "http://192.168.20.60/s".
This is where we get the values of our ADC's.
These is a script code, so better check it by yourselves what it really means. ;D ;D ;D
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Philippine Electronics Forum

Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #42 on: May 09, 2012, 12:22:59 PM »

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #43 on: May 09, 2012, 01:23:47 PM »
Code: [Select]
<table><tr><td valign=top><table border=1 style="font-size:20px ;font-family: terminal ;">
<tr><th colspan=2>ADC</th></tr>
Creates a table.
It has attributes like border size, font type, font size, etc...
A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag).
td stands for "table data," and holds the content of a data cell.
colspan=2 means that it span two columns

Code: [Select]
<tr><td>AN2</td><td><script>document.write(AN2)</script></td></tr>
<tr><td>AN3</td><td><script>document.write(AN3)</script></tr></td></table>
Displays "AN2" at row 2 cell 1 and the AN2 value at row 2 cell 2.
It also displays "AN3" at row 3 cell 1 and the AN3 value at row 3 cell 2.

Code: [Select]
<table><tr><td valign=top><table border=1 style="font-size:20px ;font-family: terminal ;">
<tr><th colspan=2>ADC</th></tr>
Creates a table.
A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag).
td stands for "table data," and holds the content of a data cell.
It also has attributes like border size, font type, font size, etc...
colspan=2 means that it span two columns

Code: [Select]
This is HTTP request #<script>document.write(REQ)</script></BODY></HTML>
" ;
Displays the number of HTTP request that the ENC receives.
</BODY> it closes the body tag.
</HTML> it closes the html tag.
" ;     tells the mikroC compiler that it's the end of the indexPage array.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Philippine Electronics Forum

Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #43 on: May 09, 2012, 01:23:47 PM »

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #44 on: May 09, 2012, 01:31:45 PM »
Hello??? Anybody home??? ;D ;D ;D

Please copy this to notepad,
Code: [Select]
<meta http-equiv="refresh" content="3;url=http://192.168.20.60">
<HTML><HEAD></HEAD><BODY>
<h1>PIC   ENC28J60 Mini Web Server</h1>
<a href=/>Reload</a>
<script src=/s></script>
<table><tr><td valign=top><table border=1 style="font-size:20px ;font-family: terminal ;">
<tr><th colspan=2>ADC</th></tr>
<tr><td>AN2</td><td><script>document.write(AN2)</script></td></tr>
<tr><td>AN3</td><td><script>document.write(AN3)</script></tr></td></table>
This is HTTP request #<script>document.write(REQ)</script></BODY></HTML>

Save it with a .htm extension. After that please double click it.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Philippine Electronics Forum

Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #44 on: May 09, 2012, 01:31:45 PM »

Offline PlCUSER

  • Diesel Generator
  • *
  • Posts: 1909
  • Pogi/Ganda Points: 152
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #45 on: May 09, 2012, 01:53:50 PM »
Hello??? Anybody home??? ;D ;D ;D
present!!!

Save it with a .htm extension. After that please double click it.

ang galing naman nito master. ganun lang pala kasimple gumawa ng webpage. ;D ;D ;D

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #46 on: May 09, 2012, 02:03:36 PM »
;D ;D ;D ;D ;D
Siawa.
Simple dahil yan lang ang kaya ko.  ;)
Saan na kaya ang dalawang yon?
Anyway maraming salamat master.
How I wish I have a mac.  ;D

On topic,
Makita natin na row 2 cell 2 at row 3 cell 2 ay walang laman, of course dahil wala tayong value sa AN2 at AN3.
Same with the number of request.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #47 on: May 09, 2012, 02:07:48 PM »
Everytime makatanggap ng request, from for example the browser, ang ENC module (and of course that includes the mcu), it calls the  SPI_Ethernet_UserTCP.

So next nating tingnan ay ang laman niyan.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline PlCUSER

  • Diesel Generator
  • *
  • Posts: 1909
  • Pogi/Ganda Points: 152
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #48 on: May 09, 2012, 02:15:18 PM »
Saan na kaya ang dalawang yon?
OT. konti na lng ang paghihintay mo master. out for deliver na dw sa sultan kudarat. ;D ;D ;D

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #49 on: May 09, 2012, 02:26:24 PM »
^ WoW!
Need ko na pala maggawa ng bagong board. :D :D
Sana malagyan na ng LCD this time since may sinama kang regulator.
Chaaaalamat talaga master.  ;D
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #50 on: May 09, 2012, 02:33:12 PM »
Excited na. ;D ;D ;D
Computer Engineering National Organization registration thread


Offline carlsberg11

  • Lead Acid Battery
  • *******
  • Posts: 526
  • Pogi/Ganda Points: 30
  • Gender: Male
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #51 on: May 09, 2012, 02:48:21 PM »
present po ako!! observer lang muna ako sir lurker.. :D :D :D
Anyone who has never made a mistakes has never tried anything new.

-Albert Einstein

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #52 on: May 15, 2012, 08:05:28 AM »
OT:

Andito na. ;D ;D




Papadala ko na ngayong araw yung sayo sir. :D
Computer Engineering National Organization registration thread


Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #53 on: May 15, 2012, 06:20:33 PM »
Testing. ;D Galing yan sa sample program. ;D


Computer Engineering National Organization registration thread


Offline PlCUSER

  • Diesel Generator
  • *
  • Posts: 1909
  • Pogi/Ganda Points: 152
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #54 on: May 15, 2012, 06:32:32 PM »
ang galing naman nyan master. tutorial pls. ;D ;D ;D

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #55 on: May 15, 2012, 06:40:01 PM »
Hintayin nalang po natin si master lurker sir. :D
Computer Engineering National Organization registration thread


Offline carlsberg11

  • Lead Acid Battery
  • *******
  • Posts: 526
  • Pogi/Ganda Points: 30
  • Gender: Male
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #56 on: May 15, 2012, 07:14:08 PM »
Hintayin nalang po natin si master lurker sir. :D

sir pa ano mo po nagawa yan? gamit din yung ENC module ni sir picuser? waaaaa! galing mo naman prof.. or pure html lang yan sir asimo? wala pang enc module? sorry po medyo confuse
Anyone who has never made a mistakes has never tried anything new.

-Albert Einstein

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #57 on: May 15, 2012, 07:14:59 PM »
sir pa ano mo po nagawa yan? gamit din yung ENC module ni sir picuser? waaaaa! galing mo naman prof.. or pure html lang yan sir asimo? wala pang enc module? sorry po medyo confuse

Ginamit ko na yung ENC ni sir PICUSER nyan sir. :D Yan na yung output mya. :D
Computer Engineering National Organization registration thread


Offline carlsberg11

  • Lead Acid Battery
  • *******
  • Posts: 526
  • Pogi/Ganda Points: 30
  • Gender: Male
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #58 on: May 15, 2012, 07:17:02 PM »
Ginamit ko na yung ENC ni sir PICUSER nyan sir. :D Yan na yung output mya. :D

paturo naman kung pa ano gamitin, nag burn ka ng new firmware dun sa pic16 prof?or naka udp bootloader kana?
Anyone who has never made a mistakes has never tried anything new.

-Albert Einstein

Offline ΔЅịMø

  • Gas Turbine
  • **
  • Posts: 2903
  • Pogi/Ganda Points: 140
  • Gender: Male
  • "Live Curious"
Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #59 on: May 15, 2012, 07:18:23 PM »
paturo naman kung pa ano gamitin, nag burn ka ng new firmware dun sa pic16 prof?or naka udp bootloader kana?

Yung UDP ang gamit ko sir. Download mo lang yung hex file nya. Gaya nung sa instruction ni sir PICUSER sa PM nya. PM lang kita kung paano. Ayaw ko munag pangunahan si sir Lurker dito. :D
Computer Engineering National Organization registration thread


Philippine Electronics Forum

Re: MikroC's SPI Ethernet ENC28J60 Library
« Reply #59 on: May 15, 2012, 07:18:23 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com