I met the problem as follows:
I had a W5500 I/O connetced to a STM32 device, and I wanted to set the MAC of W5500 and to check the response.
For the STM32F303 device, I’ve corrected the connecting pins ( MOSI, MISO, SCLK, CSC), and SPI speed was about 1M BaudRate (to ensure the speed is compatible, I used low speed). And here is the configuration of the pins:
SCK： PB13(STM32F303)——AF mode—Push Pull——Pull-up Resistance——50MHz(I/O speed)
MISO：PB14(STM32F303)——AF mode—Open Drain——Floating——50MHz
MOSI：PB15(STM32F303)——AF mode—Push Pull——Pull-up Resistance——50MHz
CSC： PB12(STM32F303)——AF mode—Push Pull——Pull-up Resistance——50MHz
For data format, I’ve noticed the data format in the W5500 datasheet ( 2 bytes offset address, 1 byte control code and then data ). I used FDM mode to transmit only 1 byte data each time, and the data was: ( MAC address )
1st: 0x00 0x09 0x05 0x00
2nd: 0x00 0x0A 0x05 0x08
3rd: 0x00 0x0B 0x05 0xDC
4th: 0x00 0x0C 0x05 0x01
5th: 0x00 0x0D 0x05 0x02
6th: 0x00 0x0E 0x05 0x03
Offset ad Control Data
NOTE: the offset address of MAC Register starts from 0x0009; the ( control code) BSB[7:3] of Common Register is 00000B; then WB bit should be 1 (write); OM[1:0] is 01B, to transmit only 1 byte each time; finally the 1 byte data.
When I wrote the MAC to W5500 via SPI, I used an oscilloscope to check the output (pin MOSI) and it was almost correct. However, the response of W5500 (pin MISO) was always HIGH, that is to say, there was no response of W5500.
The possible fault I guess is that when I reset W5500 (to reset and set the NRST pin), W5500 may need some operation to prepare itself for the SPI communication. So is there any operation should be done before the data transmission?
Hope to get your help.