Forums

problem in data reception on wiznet w5100

Started by adnan qureshi December 29, 2008
MCBSP0_DXR_32BIT = 0xf0000080; // reset DC through MR register
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

MCBSP0_DXR_32BIT = 0xf0001A55; // assign 2Kbytes Rx memory to all sockets
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

MCBSP0_DXR_32BIT = 0xf0001B55; // assign 2Kbytes Rx memory to all sockets
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

////////////////////////////////////////////////////////////////////////////

MCBSP0_DXR_32BIT = 0xf0040004; // write mode register to MACRAW mode
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

/////////////////////////////////////////////////////////////////////////////
/*
MCBSP0_DXR_32BIT = 0xf0042868; // assign starting address of recv memory
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

MCBSP0_DXR_32BIT = 0xf0042900; // assign starting address of recv memory
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );
*/
MCBSP0_DXR_32BIT = 0xf0040101; // (0xf0040141) // write command register to OPEN socket
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

/////////////////////////////////////////////////////////////////////////////

MCBSP0_DXR_32BIT = 0x0f040300;
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

/////////////////////////////////////////////////////////////////////////////

for(;;)
{
MCBSP0_DXR_32BIT = 0x0f042600; // read Rx RECEIVED SIZE REGISTER
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

a = a & 0x000000ff;
if(a != 0)
break;

MCBSP0_DXR_32BIT = 0x0f042700; // read Rx RECEIVED SIZE REGISTER
a = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

a = a & 0x000000ff;
if(a != 0)
break;

MCBSP0_DXR_32BIT = 0x0f040200; // read interrupt register
b = MCBSP0_DRR_32BIT;
asm( " nop " );
asm( " nop " );

b = b & 0x000000ff;
if(b == 0x04)
break;
}
/////////////////////// READ Rx MEMORY ///////////////////////

for(i=0;i<0x800;i++)
{
MCBSP0_DXR_32BIT = 0x0f600000 + (0x100*i);
read[i] = MCBSP0_DRR_32BIT;
}

for(i=0;i<0x800;i++)
{
MCBSP0_DXR_32BIT = 0x0f680000 + (0x100*i);
read[i] = MCBSP0_DRR_32BIT;
}

for(i=0;i<0x800;i++)
{
MCBSP0_DXR_32BIT = 0x0f700000 + (0x100*i);
read[i] = MCBSP0_DRR_32BIT;
}

for(i=0;i<0x800;i++)
{
MCBSP0_DXR_32BIT = 0x0f780000 + (0x100*i);
read[i] = MCBSP0_DRR_32BIT;
}