1 / 41

PICDEM

PICDEM.net. Carte PICDEM.net. Ethernet. RS232. Alim. PIC. RTL8019. LCD. 2 X 16. Schéma PICDEM.net. N I C. Reset. RB5. LCD, EEPROM, ICD2. RS232. Interface réseau (NIC) RTL8019. (NIC) Network Interface Controller. Transfo. et prise Ethernet. Adressage du RTL8019.

calum
Download Presentation

PICDEM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PICDEM.net

  2. Carte PICDEM.net Ethernet RS232 Alim PIC RTL8019 LCD 2 X 16

  3. Schéma PICDEM.net N I C Reset RB5

  4. LCD, EEPROM, ICD2

  5. RS232

  6. Interface réseau (NIC) RTL8019 (NIC) Network Interface Controller Transfo. et prise Ethernet

  7. Adressage du RTL8019 0 0000 0000 0110 000x xxxx Cablé à l’adresse &h300 (bus ISA)

  8. RTL8019 en boitiers 100L QFP

  9. Démonstration (mpnicee.mcp) Version pour RTL8019 ou compatible NE2000 Fichier compressé MCHPStackv211.EXE Autour du 18F452

  10. Page d’accueil

  11. Fichiers source C et web Fichiers web principale index.htm Fichiers sources principale (main) Webserv.c

  12. Liaisons PICDEM.net au PC client Port COM Port Ethernet (RJ45) PC client PICDEM.net Liaison Ethernet (RJ45) direct par câble croisé , par câble droit avec un hub ou réseau local

  13. Configuration de l’Hyper Terminal

  14. Menu de Paramètrage Réponse du PICSERVEUR après appuis en simultané de la touche reset et RB5 1 : Adresse mac en decimal pour les deux derniers octets du PICServeur (00 04 a3 00 XX XX) 2 : Adresse IP du PICServeur 3 : Passerelle Internet 4 : Masque de sous réseau 5/6 : Attribution d’adresse IP par serveur DHCP sur le reseau 7 : Transfert du fichier image des fichiers HTML et autre que le serveur retournera à la demande

  15. Configuration IP du PC

  16. Compilation des fichiers en fichier image (*.BIN) Cible du raccourci MPFS C:\MCHPStack\source\MPFS.exe C:\MCHPStack\Source\WebPages test.bin

  17. Transfert du fichier image par l’Hyper Terminal

  18. Transfert du fichier image par FTP Utilisateur : ftp Mot de passe : microchip Cible du raccourci (FTP) C:\MCHPStack\ftp\ftp.exe 192.168.0.2

  19. INDEX.HTM <HTML> <HEAD> <TITLE>Microchip TCP/IP Stack Demo</TITLE> </HEAD> <FRAMESET rows="15%,40%,20%" border=0> <FRAME name="top" src="Header.htm" marginheight=0 marginwidth=10> <FRAME name="middle" src="Home.htm" marginheight=5 marginwidth=10> <FRAMESET cols="50%,50%" border=0> <FRAME name="left" src="Status.cgi" marginheight=2 marginwidth=50%> <FRAME name="right" src="Commands.cgi" marginheight=2 marginwidth=50%> </FRAMESET> </FRAMESET> </HTML>

  20. HOME.HTM <html> <head><title>PICStack Home</title></head> <body bgcolor="#FFFFFF"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td valign="top" width="50%"><font color="#000000"> <strong>Welcome!</strong></font></a><p><font color="#000000"> This site is used to demonstrate the power and abilities of an 8-bit embedded web server. This site is powerd by Microchip PIC microcontroller running Microchip TCP/IP Stack. Everything you see is served through a Microchip PICDEM.net Internet/Ethernet demonstration board.</font></p></td> <td valign="top" width="50%"><font color="#000000"> Bottom half of this page illustrates a real-time control of PICDEM.net board. &quot;Status&quot; section refreshes board information every few seconds and &quot;Commands&quot; section issues command to toggle on-board LEDs. </font><p><font color="#000000"> Push on-board switch or rotate one of the potentiometers and see the screen getting updated. You may also click on one of the two LED command buttons toggle on-boad LEDs.</font></p> </td> </tr> </table> </body> </html>

  21. STATUS.CGI <html> <meta http-equiv="refresh" content="3"> <body> <table> <tr><td><b>Results</b></td></tr> <tr><td>Pot1:</td><td>%02</td></tr> <tr><td>Pot2:</td><td>%03</td></tr> </table> <table cellpadding="3"> <tr><td>Switch:</td><td>%04</td></tr> <tr><td>LEDs:</td><td>D6=%01</td><td>D5=%00</td></tr> </table> </body> </html> Declaration dans (websrvr.c) /* * CGI Variable codes. - There could be 0-255 variables. */ #define VAR_LED_D5 (0) #define VAR_LED_D6 (1) #define VAR_ANAIN_AN0 (2) #define VAR_ANAIN_AN1 (3) #define VAR_DIGIN_RB5 (4)

  22. “Sniffer” STATUS.CGI PC PICServeur PC PICServeur

  23. Webserv.cFonction “HTTPGetVar” WORD HTTPGetVar(BYTE var, WORD ref, BYTE* val) { switch(var) { case VAR_LED_D5: if ( LATA3 ) *val = '0'; else *val = '1'; break; …………….. case VAR_ANAIN_AN0: if ( ref == HTTP_START_OF_VAR ) { ref = (BYTE)0; } *val = AN0String[(BYTE)ref]; if ( AN0String[(BYTE)ref] == '\0' ) return HTTP_END_OF_VAR; (BYTE)ref++; return ref;

  24. COMMAND.CGI Valeur renvoyé au serveur par clic sur "Toggle LED1 ou 2" <html> <body bgcolor="#FFFFFF"> <FORM METHOD=GET action=0> <table> <tr><td><b>Commands</b></td></tr> <tr><td><input type=submit name=0 value="Toggle LED1"></td></tr> <tr><td><input type=submit name=1 value="Toggle LED2"></td></tr> </table> </body> </html>

  25. “Sniffer” COMMAND.CGI <tr><td><input type=submit name=0 value="Toggle LED1"></td></tr>

  26. Webserv.cFonction “HTTPExecCmd” Fonction > void HTTPExecCmd(BYTE** argv, BYTE argc) dans (websrvr.c) var = argv[1][0] - '0'; switch(var) { case VAR_LED_D5: /* * This is "D5". * Toggle D5. */ LATA3 ^= 1; break; case VAR_LED_D6: /* * This is "D6". * Toggle it. */ LATA2 ^= 1; break; } Exécution des commandes : Valeurs retournées par un clic sur “Toggle LED1” “http:192.168.0.2/0?0=Toggle+LED1”

  27. 0?0=Toggle+LED1 Overview: This function is a "callback" from HTTPServer task. Whenever a remote node performs interactive task on page that was served, HTTPServer calls this functions with action arguments info. Main application should interpret this argument and act accordingly. Following is the format of argv: If HTTP action was : thank.htm?name=Joe&age=25 argv[0] => thank.htm argv[1] => name argv[2] => Joe argv[3] => age argv[4] => 25

  28. Carte test ISA RTL8019“NE2000” ISA

  29. RESET RS232 LED1 LED2 POT1 POT2 RB5 VLCD

  30. Edition de pages HTML (MOZILLA)

  31. “Edition avec MozillaCOMMAND.CGI

  32. “Sniffer” COMMAND.CGI

  33. ApplicationContrôle d’un réseau de gaz

  34. Surveillanced’un réseau de gaz

  35. Inverseur semi automatique Inverseur Manuel Pressostats Gaz Argon

  36. Pressostat Contact

  37. Surveillance d’un réseau de gaz

  38. Webserv.cFonction “WORD HTTPGetVar(BYTE var, WORD ref, BYTE* val)” …. case VAR_DIGIN_RB5: if ( PORTB_RB5 ) *val = '1'; else *val = '0'; break; case VAR_DIGIN_RB6: if ( PORTB_RB6 ) *val = '1'; else *val = '0'; break; case VAR_DIGIN_RB7: if ( PORTB_RB7 ) *val = '1'; else *val = '0'; break; } …..

  39. En conclusion Explorateur HTTP NIC STACK IP Command CGI Sortie FTP HTTPExecCmd Status CGI EEPROM Entrée HTTPGetVar

More Related