W5500 SPI not working

Hi,

We have made our own W5500 custom board and the SPI is not working, we checked MOSI and MISO on the oscilloscope, but we see only MOSI pulses, the W5500 chip is not responding.
And on power ON I am reading chip version.

#define W5500_SPI_READ (0x00 << 2) //< SPI interface Read operation in Control Phase

unsigned char ucWizRead(unsigned long AddrSel)
{
unsigned char ret ;
CE_HIGH() ; // Chip Deselect
_nop();
_nop();
_nop();
CE_LOW() ; // Chip Select
_nop();
_nop();
_nop();

// 0x00003900 Chip Version of Address
AddrSel |= (W5500_SPI_READ | 0x00) ; // Address Phase + Control Phase

vfnSPI_SendByte((AddrSel & 0x00FF0000) >> 16) ;
vfnSPI_SendByte((AddrSel & 0x0000FF00) >> 8) ;
vfnSPI_SendByte((AddrSel & 0x000000FF) >> 0) ;

ret = ucfnSPI_ReceiveByte() ; // Read the response from W5500 chip
_nop();
_nop();
_nop();

CE_HIGH() ; // Chip Deselect
return ret ;
}

// Function for Send byte to W5500
void vfnSPI_SendByte ( unsigned char ucData )
{
unsigned char ucBitIndex = 0x80 ;
unsigned char ucLocal = 0 ;

for ( ucLocal = 0 ; ucLocal < 8 ; ucLocal++ )
{
	if ( ucData & ucBitIndex )
		SI_HIGH() ;                                 // starts from MSB and if high will give high pulse
	else
		SI_LOW() ;

	SCK_HIGH() ;                                  // Generate Clock Pulse
	_NOP();
	_NOP() ;
	_NOP() ;
	_NOP() ;
	SCK_LOW() ;
	ucBitIndex >>= 1 ;
}

}

// Receive function
unsigned char ucfnSPI_ReceiveByte ()
{
unsigned char ucData = 0x00, ucLocal, ucBitIndex = 0x80 ;

for ( ucLocal = 0 ; ucLocal < 8 ; ucLocal++ )
{
	if ( IS_SO_HIGH() )
		ucData |= ucBitIndex ;              // If there is data from W5500 it will make that bit high.

	SCK_HIGH() ;                           // Generate Serial Clock Pulse
	_NOP() ;
	_NOP() ;
	_NOP() ;
	_NOP() ;
	SCK_LOW() ;

	ucBitIndex >>= 1 ;
}
return ucData ;

}

Please help me!

Reference Circuit: ETHERNET PDF.pdf (22.8 KB)

Please put comments into your source code so that we would not have to guess what you are doing in there. What is the value of " W5500_SPI_READ"? Draw the diagram of what goes to SPI and what you expect to get.

What do you mean - not responsing?

We are not getting any signal on MISO line.

Any signal?

Hi sir,
As I am requesting Chip version, always getting 0x00, what could be the fault and how to check whether the chip is functioning or not?

You are not answering the questions asked, and asking more questions instead. How it is possible to help you?

Sir,
I have edited the post by commenting the code. And yes I am not getting any signal on the MISO line.

Sir,

Please help me!

Hi~
The MISO of W5500 signal shows Dummy data…
If you read the chip version of W5500, you can show Dummy data as below.

    ---ADDRH-----ADDRL-----OP------DATA
MOSI     0x00    0x39     0x00    DUMMY
MISO     0x01    0x02     0x03    0x04

Could you please try the test?

thanks
best regards
irina

Thanks,
There was crystal oscillator problem. SPI worked fine.
But when I plugged in the Ethernet cable no LED’s are blinking.