LAN8720 MII communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LAN8720 MII communication

3,020 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kenjia@sannet.ne.jp on Sat Sep 04 18:07:34 MST 2010
Hi All,
I could not initialize a interface LAN7820A on LPC1768 Xpresso Board.
SW cannot recognize 7820 registers.

For DP83848C, followings are definition for base address.[INDENT]   #define DP83848C_DEF_ADR    0x0100
  #define DP83848C_ID         0x20005C90
[/INDENT]I'm using follows for 7820 same as 83848.[INDENT]   #define LAN8720_DEF_ADR        0x0100
  #define LAN8720_ID          0x0007C0F0
[/INDENT]I tried to use also below.[INDENT]   #define LAN8720_DEF_ADR        0x0100
[/INDENT]For reset action and wait for reset completion, it always return us=0xffff.[INDENT]       /* Put the PHY in reset mode */
      // PHY_REG_BMCR=0, MCFG_RES_MII=0x8000
      prvWritePHY( PHY_REG_BMCR, MCFG_RES_MII );

      /* Wait for hardware reset to end. */
      for( x = 0; x < 100; x++ ){[INDENT]              vTaskDelay( emacSHORT_DELAY * 5 );   // FreeRTOS delay
             us = prvReadPHY( PHY_REG_BMCR, &lDummy );
             if( !( us & MCFG_RES_MII ) ){[INDENT]                     /* Reset complete */
                   break;
[/INDENT]}
[/INDENT]}
[/INDENT]Does anyone already success Ethernet control?
Thank you for your support in advance.

Best regards,
Kenji
0 Kudos
Reply
7 Replies

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by terrype on Tue Aug 26 21:28:32 MST 2014
Hi Liu, Did you solve the probelm with embTCP with FreeRTos and LPC1769 expresso board?
0 Kudos
Reply

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by terrype on Tue Aug 26 21:27:03 MST 2014
I am using embTCP with FreeRTos and could you share with me what are the modification required to work
0 Kudos
Reply

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by glennliu on Tue Jun 04 20:18:29 MST 2013
is embTCP needed for this setup? or you guys write the protocol yourself?
0 Kudos
Reply

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kenjia@sannet.ne.jp on Tue Sep 07 05:02:49 MST 2010
Hi CodeRedSupport,
thanks your support.
I understood that RDB1768 board started w/ DP83848 PHY then v2 board w/LAN8720 PHY.
I have confirmed latest program at the link. Thanks again.

For FreeRTOS, I already modified several c and h files and it works fine.
Right now, my application program w/ FreeRTOS is working well both LPC1768 mbed and LPCXpresso.

Regards,
Kenji
http://www.page.sannet.ne.jp/kenjia/index.html
0 Kudos
Reply

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Sep 05 13:07:55 MST 2010

Quote: kenjia@sannet.ne.jp

So I quickly set it up and tried same source code which you mentioned as below.
   [FONT=&quot]http://ics.nxp.com/support/lpcxpresso/zip/examples.rdb1768.zip[/FONT]
 


Please note that the latest version of the RDB examples can be found in the LPCXPresso 3.5.0 examples subdirectory, or at:

http://support.code-red-tech.com/CodeRedWiki/RDB1768V2Support
http://support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects

IIRC the zip you refer to on the NXP website is a little out of date now.

With regards to freertos, it is possible that their uip demo has not been updated to take into account that the RDB1768v2 board, as well as the LPCXPresso1768, use a different ethernet phy to the original RDB1768 board. This might account for the problems you appear to have been having.

Regards,
CodeRedSupport
0 Kudos
Reply

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kenjia@sannet.ne.jp on Sun Sep 05 01:36:45 MST 2010
Hi mio,
thank you for your advice.
I didn't use a LPCXpresso IDE environment till today.
So I quickly set it up and tried same source code which you mentioned as below.
   [FONT=&quot]http://ics.nxp.com/support/lpcxpresso/zip/examples.rdb1768.zip[/FONT]
 
I modified following C and H files and I successfully got a ping acknowledgment from LPC1768 via LAN7820A.
main.c -> IP address
lpc.17xx_emac.c -> Registers change to LAN7820A
lpc17xx_emac.h -> Same as above

Result is follows.[INDENT]#define LAN8720_DEF_ADR        0x0100
  #define LAN8720_ID          0x0007C0F0
[/INDENT]I still have a problem on the FreeRTOS but I try to fix it.
Thanks your suggestion.

Kenji

PS:
I attached a zip file which shows some modification parts for who is having same trouble.
0 Kudos
Reply

2,588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mio on Sat Sep 04 20:29:39 MST 2010
Hi,Kenji

I now tested sample 'RDB1768cmsis_uIP' (but not FreeRTOS).
lpcXpresso1768 board works OK.

That sample code' s id read code is in lpc17xx_emac.c , approx line 100
------------------------------------------------------
  /* Check if this is a DP83848C PHY. */
  id1 = read_PHY (PHY_REG_IDR1);
  id2 = read_PHY (PHY_REG_IDR2);
  phy_id = ((id1 << 16) | (id2 & 0xFFF0));
 
#if    defined (KEIL_BOARD_MCB17XX) || defined (CODERED_BOARD_RDB1768)
      if ((phy_id != DP83848C_ID) && (phy_id != LAN8720_ID))
#else
    #error "No board"
#endif         
      return FALSE;

-------------------------------------
I try to stop this after get phy_id , debugger shows "phy_is == 508144" (0x7C0F0)

Best Regards,
mio
0 Kudos
Reply