LPC1768 Mini-DK EasyWeb application with SPI TFT output. Started from EasyWebCR and modified for DM9161 PHY support.

Dependencies:   Mini-DK mbed

This is a very basic EasyWeb application.

No error checking is performed during initialisation.

Information

If the webpage is not reachable or the 'Webserver running' message does not appear, press the reset button on the Mini-DK and wait until the message 'Webserver running' appears.
This happens sometimes when powering up the Mini-DK because the DM9161 reset pin is NOT controlled by the LPC1768, it is directly connected to the reset button.

IP adress/mask/gateway in tcpip.h : 192.168.0.200 / 255.255.255.0 / 192.168.0.1

MAC address in ethmac.h : 6-5-4-3-2-1

Files at this revision

API Documentation at this revision

Comitter:
frankvnk
Date:
Sat Dec 22 17:03:00 2012 +0000
Parent:
0:636056c0b5e1
Child:
2:52ecf365db64
Commit message:
ethmac.c - EMAC_clkdiv[] had too few dividers for high cpu clock.
; EMAC_clkdiv[] = { 4, 6, 8, 10, 14, 20, 28 };
; replaced with
; EMAC_clkdiv[] = { 4, 6, 8, 10, 14, 20, 28, 36, 40, 44, 48, 52, 56, 60, 64 };
;
;

Changed in this revision

easyweb.c Show annotated file Show diff for this revision Revisions of this file
ethmac.c Show annotated file Show diff for this revision Revisions of this file
--- a/easyweb.c	Fri Dec 21 15:41:54 2012 +0000
+++ b/easyweb.c	Sat Dec 22 17:03:00 2012 +0000
@@ -47,7 +47,7 @@
     TFT.set_font((unsigned char*) Arial12x12);  // select the font
 
     // Display IP/MAC settings stored in tcpip.h and ethmac.h
-    // MAC address : 1-2-3-4-5-6        Stored in ethmac.h (MYMAC_1 to MYMAC_6)
+    // MAC address : 6-5-4-3-2-1        Stored in ethmac.h (MYMAC_1 to MYMAC_6)
     // IP address  : 192.168.0.200      Stored in tcpip.h  (MYIP_1 to MYIP_4)
     // gateway     : 192.168.0.1        Stored in tcpip.h  (GWIP_1 to GWIP_1)
     // mask        : 255.255.255.0      Stored in tcpip.h  (SUBMASK_1 to SUBMASK_4)
@@ -55,7 +55,7 @@
     printf("IP address\n");
     printf("%d.%d.%d.%d\n\n",MYIP_1,MYIP_2,MYIP_3,MYIP_4);
     printf("MAC address\n");
-    printf("%02X:%02X:%02X:%02X:%02X:%02X\n\n",MYMAC_1, MYMAC_2, MYMAC_3, MYMAC_4, MYMAC_5, MYMAC_6);
+    printf("%02X:%02X:%02X:%02X:%02X:%02X\n\n",MYMAC_6, MYMAC_5, MYMAC_4, MYMAC_3, MYMAC_2, MYMAC_1);
     
     TCPLowLevelInit();
 
--- a/ethmac.c	Fri Dec 21 15:41:54 2012 +0000
+++ b/ethmac.c	Sat Dec 22 17:03:00 2012 +0000
@@ -26,7 +26,7 @@
 #include "tcpip.h"
 
 /* MII Mgmt Configuration register - Clock divider setting */
-const uint8_t EMAC_clkdiv[] = { 4, 6, 8, 10, 14, 20, 28 };
+const uint8_t EMAC_clkdiv[] = { 4, 6, 8, 10, 14, 20, 28, 36, 40, 44, 48, 52, 56, 60, 64 };
 
 // static pointers for receive and transmit
 static unsigned short *rxptr;
@@ -112,13 +112,6 @@
   LPC_EMAC->CLRT = CLRT_DEF;
   LPC_EMAC->IPGR = IPGR_DEF;
 
-
-  /* Enable Reduced MII interface. */
-/*  REPLACED BY ABOVE CODE (find the clock...)
-  LPC_EMAC->MCFG = MCFG_CLK_DIV64 | MCFG_RES_MII;
-  for (loop = 100; loop; loop--);
-  LPC_EMAC->MCFG = MCFG_CLK_DIV64;*/
-
   // Set MAC Command Register to enable Reduced MII interface
   // and prevent runt frames being filtered out
   LPC_EMAC->Command = CR_RMII | CR_PASS_RUNT_FRM;