EmbeddedRelated.com
Forums

TCP/IP send and receive with LPC2378

Started by "h.belig" July 24, 2008
This is documented in the errata, and it's dependant on the chip
version. I use the following code to make it work independant of the
chip version:

/* Note, there is a bug with older LPC23xx chips which require to set
P1.6
(ENET-TX_CLK) or not depending on the version of the EMAC module. We
therfore test here against this version and act acordingly. */
regVal = MAC_MODULEID;
if( regVal == NXP_OLD_MAC_MODULE_ID )
PINSEL2 = 0x50151105; /* selects P1[0,1,4,6,8,9,10,14,15] */
else
PINSEL2 = 0x50150105; /* selects P1[0,1,4,8,9,10,14,15] */

MAC_MODULEID is defined like this:

#define MAC_MODULEID (*(volatile unsigned long *)(MAC_BASE_ADDR +
0xFFC)) /* Module ID reg (RO) */

and NXP_OLD_MAC_MODULE_ID is defined like this:

#define NXP_OLD_MAC_MODULE_ID (UINT32) ((0x3902 << 16) | 0x2000)

HTH

Markus

Glazar, Bostjan schrieb:
>
> I had the same experience.
>
> However, I have only needed EMAC driver. I took the driver from
> lwIpWep.zip and used it with my existing project.
> I couldn't find my post with a bug, therefore I'm posting part of it
> below again.
> There is a hardware bug associated with this that is described in the
> LPC Errata. There is also algorithm for the code to detect chip
> revision and use the correct EMAC initialisation.
>
> Sorry for late answer... I was on vacation.
>
> When initing EMAC reserved bits in PINSEL registers should not be
> written 1. When this is the case the CPU crashed on EMAC init. I did
> not know this and thought that the requirement of not writing ones is
> for forward compatibility only.
> In the function Init_EMAC() there is:
> PINSEL2 = 0x55555555;
> It should be:
> PINSEL2 = 0x50150105;
>
> > I downloaded lwIpWep.zip and loaded lwIpWeb.hex to the MCB2300 board.
> > There was that text on the LCD display but Firefox did not show any
> > result.
> > I then adapted the IP address to my LAN and loaded the file again - no
> > improvement.
>
>
>
>

An Engineer's Guide to the LPC2100 Series

Thank you Markus, thank you Bostjan.
I will check that as soon as I have got a full IDE.
Your remarks are very valuable for me.
Thank you very much!!!

Henry

--- In l..., Markus Zingg wrote:
>
> This is documented in the errata, and it's dependant on the chip
> version. I use the following code to make it work independant of the
> chip version:
>
> /* Note, there is a bug with older LPC23xx chips which require to
set
> P1.6
> (ENET-TX_CLK) or not depending on the version of the EMAC
module. We
> therfore test here against this version and act acordingly. */
> regVal = MAC_MODULEID;
> if( regVal == NXP_OLD_MAC_MODULE_ID )
> PINSEL2 = 0x50151105; /* selects P1[0,1,4,6,8,9,10,14,15] */
> else
> PINSEL2 = 0x50150105; /* selects P1[0,1,4,8,9,10,14,15] */
>
> MAC_MODULEID is defined like this:
>
> #define MAC_MODULEID (*(volatile unsigned long
*)(MAC_BASE_ADDR +
> 0xFFC)) /* Module ID reg (RO) */
>
> and NXP_OLD_MAC_MODULE_ID is defined like this:
>
> #define NXP_OLD_MAC_MODULE_ID (UINT32) ((0x3902 << 16) | 0x2000)
>
> HTH
>
> Markus
>
> Glazar, Bostjan schrieb:
> >
> > I had the same experience.
> >
> > However, I have only needed EMAC driver. I took the driver from
> > lwIpWep.zip and used it with my existing project.
> > I couldn't find my post with a bug, therefore I'm posting part of it
> > below again.
> > There is a hardware bug associated with this that is described in the
> > LPC Errata. There is also algorithm for the code to detect chip
> > revision and use the correct EMAC initialisation.
> >
> > Sorry for late answer... I was on vacation.
> >
> > When initing EMAC reserved bits in PINSEL registers should not be
> > written 1. When this is the case the CPU crashed on EMAC init. I did
> > not know this and thought that the requirement of not writing ones is
> > for forward compatibility only.
> > In the function Init_EMAC() there is:
> > PINSEL2 = 0x55555555;
> > It should be:
> > PINSEL2 = 0x50150105;
> >
> > > I downloaded lwIpWep.zip and loaded lwIpWeb.hex to the MCB2300
board.
> > > There was that text on the LCD display but Firefox did not show any
> > > result.
> > > I then adapted the IP address to my LAN and loaded the file
again - no
> > > improvement.
> >
> >
> >
>
Maybe this is helpful for some people:

It lets you sort the pin layout table for the LPC2378/88 in various ways.
Useful when you're looking for alternate pins for a certain peripheral or
want to map a physical pin number to a port/pin combination (or vice versa).

http://www.claessen.com/2388

~ Paul Claessen