EmbeddedRelated.com
Forums

LPC2368 problem with EMAC

Started by Ilian April 2, 2007
Hello,

I'm using lpc2368 with DP83848C chips and I have a problem...
The problem is that MAC_COMMAND = 0x0038; (at 0xFFE00100) makes JTAG
debbuger to fail...
If I comment this line all works fine, but I can not reset rx and tx
paths.
With MAC_COMMAND = 0x0200; only also - no problems, but if set any of
reset bits (Regreset, RxReset or TxReset) the problems appear. I use
crossworks 1.6 , FreeRTOS and LWIP stacks.
When debug the debbuger pass MAC_COMMAND = 0x0038; and on MAC_MAC1 = 0x0;
the nessage "Cannot Stop Target" appears. If use MAC_COMMAND = 0x0038
or simply don't write to MAC_COMMAND register all is ok... What I make
wrong ? At the beggining I thought the problem is in PLL I have run it
on ARM core on 60 MHz, so I have put different settings on PLL but
same result... :(
Also I have run the same source on LPC2378 from Olimex and it works fine.

Thanks in advance.
int main(void)
{
unsigned long i, regValue;
unsigned long timeout;

TargetResetInit();

PCONP |= 0x40000000; // enable EMAC clock
PINSEL2 = 0x50151105; // selects P1[0,1,4,8,9,10,14,15]
PINSEL3 = 0x00000005; // selects P1[17:16]
MAC_MAC1 = 0xCF00;// [15],[14],[11:8] -> soft resets all MAC
internal modules
MAC_COMMAND = 0x0038; // This will not work
//MAC_COMMAND = 0x0200; // But this will work fine
for ( i = 0; i < 0x04; i++ ); // short delay after reset

MAC_MAC1 = 0x0; // deassert all of the above soft resets in MAC1

An Engineer's Guide to the LPC2100 Series

Have you tried putting a delay in after you turn on the EMAC and setup the PINSEL? I am doing exactly the same things with a LCP2366 except I turn on the EMAC hardware in my Target Init and then do other init stuff before getting to the MAC init, hence creating an unintentional delay.
-Chris

----- Original Message ----
From: Ilian
To: l...
Sent: Tuesday, April 3, 2007 1:53:53 PM
Subject: [lpc2000] LPC2368 problem with EMAC

Hello,

I'm using lpc2368 with DP83848C chips and I have a problem...

The problem is that MAC_COMMAND = 0x0038; (at 0xFFE00100) makes JTAG

debbuger to fail...

If I comment this line all works fine, but I can not reset rx and tx

paths.

With MAC_COMMAND = 0x0200; only also - no problems, but if set any of

reset bits (Regreset, RxReset or TxReset) the problems appear. I use

crossworks 1.6 , FreeRTOS and LWIP stacks.

When debug the debbuger pass MAC_COMMAND = 0x0038; and on MAC_MAC1 = 0x0;

the nessage "Cannot Stop Target" appears. If use MAC_COMMAND = 0x0038

or simply don't write to MAC_COMMAND register all is ok... What I make

wrong ? At the beggining I thought the problem is in PLL I have run it

on ARM core on 60 MHz, so I have put different settings on PLL but

same result... :(

Also I have run the same source on LPC2378 from Olimex and it works fine.

Thanks in advance.

int main(void)

{

unsigned long i, regValue;

unsigned long timeout;

TargetResetInit( );

PCONP |= 0x40000000; // enable EMAC clock

PINSEL2 = 0x50151105; // selects P1[0,1,4,8,9, 10,14,15]

PINSEL3 = 0x00000005; // selects P1[17:16]

MAC_MAC1 = 0xCF00;// [15],[14],[11: 8] -> soft resets all MAC

internal modules

MAC_COMMAND = 0x0038; // This will not work

//MAC_COMMAND = 0x0200; // But this will work fine

for ( i = 0; i < 0x04; i++ ); // short delay after reset

MAC_MAC1 = 0x0; // deassert all of the above soft resets in MAC1



____________________________________________________________________________________
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/
Thanks for reply Chris...
I have put delay and the result is the same... Do you use DP83848C ? My connections are the same as in MBC2300 board v 3.0 from Keil.
I have just check with oscilloscope the communication over Serial Management interface (MDC and MDIO) I have found that data are correctly send to the DP83848C but there is no answer ... So, does somebody knows what actually happens or performed when reset Regreset, RxReset or TxReset bit are set in MAC Command register ? Is it possible to block the processor if interface with DP83848C doesn't works ?
Another question I wish to ask somebody that have MBC2300 board is :
- Which address do you use for accessing DP83848 , cause default is 0x01 so I expect 0x01, but in examples the address set on MADR 12:8 is 0x00 ?

Regards,
Ilian
Chris Cook wrote: Have you tried putting a delay in after you turn on the EMAC and setup the PINSEL? I am doing exactly the same things with a LCP2366 except I turn on the EMAC hardware in my Target Init and then do other init stuff before getting to the MAC init, hence creating an unintentional delay.
-Chris

----- Original Message ----
From: Ilian
To: l...
Sent: Tuesday, April 3, 2007 1:53:53 PM
Subject: [lpc2000] LPC2368 problem with EMAC

Hello,

I'm using lpc2368 with DP83848C chips and I have a problem...

The problem is that MAC_COMMAND = 0x0038; (at 0xFFE00100) makes JTAG

debbuger to fail...

If I comment this line all works fine, but I can not reset rx and tx

paths.

With MAC_COMMAND = 0x0200; only also - no problems, but if set any of

reset bits (Regreset, RxReset or TxReset) the problems appear. I use

crossworks 1.6 , FreeRTOS and LWIP stacks.

When debug the debbuger pass MAC_COMMAND = 0x0038; and on MAC_MAC1 = 0x0;

the nessage "Cannot Stop Target" appears. If use MAC_COMMAND = 0x0038

or simply don't write to MAC_COMMAND register all is ok... What I make

wrong ? At the beggining I thought the problem is in PLL I have run it

on ARM core on 60 MHz, so I have put different settings on PLL but

same result... :(

Also I have run the same source on LPC2378 from Olimex and it works fine.

Thanks in advance.

int main(void)

{

unsigned long i, regValue;

unsigned long timeout;

TargetResetInit( );

PCONP |= 0x40000000; // enable EMAC clock

PINSEL2 = 0x50151105; // selects P1[0,1,4,8,9, 10,14,15]

PINSEL3 = 0x00000005; // selects P1[17:16]

MAC_MAC1 = 0xCF00;// [15],[14],[11: 8] -> soft resets all MAC

internal modules

MAC_COMMAND = 0x0038; // This will not work

//MAC_COMMAND = 0x0200; // But this will work fine

for ( i = 0; i < 0x04; i++ ); // short delay after reset

MAC_MAC1 = 0x0; // deassert all of the above soft resets in MAC1



__________________________________________________________
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/



---------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
Hi Ilian,

I had this problem already. Proper configuration of EMAC can not be
done if you don't have 25MHz on REF_CLK. You must be sure that pins
PFBOUT, PFBIN1 and PFBIN2 are shorted, without this you will not have
25MHz out even if PHY chip is enabled.

Regards,
Aleksandar

--- In l..., "Ilian" wrote:
>
> Hello,
>
> I'm using lpc2368 with DP83848C chips and I have a problem...
> The problem is that MAC_COMMAND = 0x0038; (at 0xFFE00100) makes JTAG
> debbuger to fail...
> If I comment this line all works fine, but I can not reset rx and tx
> paths.
> With MAC_COMMAND = 0x0200; only also - no problems, but if set any of
> reset bits (Regreset, RxReset or TxReset) the problems appear. I use
> crossworks 1.6 , FreeRTOS and LWIP stacks.
> When debug the debbuger pass MAC_COMMAND = 0x0038; and on MAC_MAC1
= 0x0;
> the nessage "Cannot Stop Target" appears. If use MAC_COMMAND = 0x0038
> or simply don't write to MAC_COMMAND register all is ok... What I make
> wrong ? At the beggining I thought the problem is in PLL I have run it
> on ARM core on 60 MHz, so I have put different settings on PLL but
> same result... :(
> Also I have run the same source on LPC2378 from Olimex and it works
fine.
>
> Thanks in advance.
> int main(void)
> {
> unsigned long i, regValue;
> unsigned long timeout;
>
> TargetResetInit();
>
> PCONP |= 0x40000000; // enable EMAC clock
> PINSEL2 = 0x50151105; // selects P1[0,1,4,8,9,10,14,15]
> PINSEL3 = 0x00000005; // selects P1[17:16]
> MAC_MAC1 = 0xCF00;// [15],[14],[11:8] -> soft resets all MAC
> internal modules
> MAC_COMMAND = 0x0038; // This will not work
> //MAC_COMMAND = 0x0200; // But this will work fine
> for ( i = 0; i < 0x04; i++ ); // short delay after reset
>
> MAC_MAC1 = 0x0; // deassert all of the above soft resets in MAC1
>
Hi Aleksandar,

Thanks for your reply!
Do you use MII mode ? I have configured LPC2368 in PMII mode and the DP83848 requires for RMII mode 50MHz and exactly 50MHz will be provided on 25MHZ_OUT (pin 25 ) on PHY, that signal I use for RX_REF_CLK. If you work with the same chips can you tell me when the signal on DP83848 pin 25 start to generate impuls - imediatelly after power-up or I requires some boot sequence ?
I'm going to check PFBOUT, PFBIN1 and PFBIN2 right now. The again for help !

Regards,
Ilian

Aleksandar Savic wrote: Hi Ilian,

I had this problem already. Proper configuration of EMAC can not be
done if you don't have 25MHz on REF_CLK. You must be sure that pins
PFBOUT, PFBIN1 and PFBIN2 are shorted, without this you will not have
25MHz out even if PHY chip is enabled.

Regards,
Aleksandar

--- In l..., "Ilian" wrote:
>
> Hello,
>
> I'm using lpc2368 with DP83848C chips and I have a problem...
> The problem is that MAC_COMMAND = 0x0038; (at 0xFFE00100) makes JTAG
> debbuger to fail...
> If I comment this line all works fine, but I can not reset rx and tx
> paths.
> With MAC_COMMAND = 0x0200; only also - no problems, but if set any of
> reset bits (Regreset, RxReset or TxReset) the problems appear. I use
> crossworks 1.6 , FreeRTOS and LWIP stacks.
> When debug the debbuger pass MAC_COMMAND = 0x0038; and on MAC_MAC1
= 0x0;
> the nessage "Cannot Stop Target" appears. If use MAC_COMMAND = 0x0038
> or simply don't write to MAC_COMMAND register all is ok... What I make
> wrong ? At the beggining I thought the problem is in PLL I have run it
> on ARM core on 60 MHz, so I have put different settings on PLL but
> same result... :(
> Also I have run the same source on LPC2378 from Olimex and it works
fine.
>
> Thanks in advance.
>
>
> int main(void)
> {
> unsigned long i, regValue;
> unsigned long timeout;
>
> TargetResetInit();
>
> PCONP |= 0x40000000; // enable EMAC clock
> PINSEL2 = 0x50151105; // selects P1[0,1,4,8,9,10,14,15]
> PINSEL3 = 0x00000005; // selects P1[17:16]
> MAC_MAC1 = 0xCF00;// [15],[14],[11:8] -> soft resets all MAC
> internal modules
> MAC_COMMAND = 0x0038; // This will not work
> //MAC_COMMAND = 0x0200; // But this will work fine
> for ( i = 0; i < 0x04; i++ ); // short delay after reset
>
> MAC_MAC1 = 0x0; // deassert all of the above soft resets in MAC1
>

---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
IT WORKS now !!!

I really has same problems and leave PFBOUT, PFBIN1 not shorted... I have shorted them and now all works fine ! Thanks you very much Alexander!

Regards,
Ilian

Aleksandar Savic wrote: Hi Ilian,

I had this problem already. Proper configuration of EMAC can not be
done if you don't have 25MHz on REF_CLK. You must be sure that pins
PFBOUT, PFBIN1 and PFBIN2 are shorted, without this you will not have
25MHz out even if PHY chip is enabled.

Regards,
Aleksandar

--- In l..., "Ilian" wrote:
>
> Hello,
>
> I'm using lpc2368 with DP83848C chips and I have a problem...
> The problem is that MAC_COMMAND = 0x0038; (at 0xFFE00100) makes JTAG
> debbuger to fail...
> If I comment this line all works fine, but I can not reset rx and tx
> paths.
> With MAC_COMMAND = 0x0200; only also - no problems, but if set any of
> reset bits (Regreset, RxReset or TxReset) the problems appear. I use
> crossworks 1.6 , FreeRTOS and LWIP stacks.
> When debug the debbuger pass MAC_COMMAND = 0x0038; and on MAC_MAC1
= 0x0;
> the nessage "Cannot Stop Target" appears. If use MAC_COMMAND = 0x0038
> or simply don't write to MAC_COMMAND register all is ok... What I make
> wrong ? At the beggining I thought the problem is in PLL I have run it
> on ARM core on 60 MHz, so I have put different settings on PLL but
> same result... :(
> Also I have run the same source on LPC2378 from Olimex and it works
fine.
>
> Thanks in advance.
>
>
> int main(void)
> {
> unsigned long i, regValue;
> unsigned long timeout;
>
> TargetResetInit();
>
> PCONP |= 0x40000000; // enable EMAC clock
> PINSEL2 = 0x50151105; // selects P1[0,1,4,8,9,10,14,15]
> PINSEL3 = 0x00000005; // selects P1[17:16]
> MAC_MAC1 = 0xCF00;// [15],[14],[11:8] -> soft resets all MAC
> internal modules
> MAC_COMMAND = 0x0038; // This will not work
> //MAC_COMMAND = 0x0200; // But this will work fine
> for ( i = 0; i < 0x04; i++ ); // short delay after reset
>
> MAC_MAC1 = 0x0; // deassert all of the above soft resets in MAC1
>

---------------------------------
Don't get soaked. Take a quick peek at the forecast
with theYahoo! Search weather shortcut.