Use SPI to set MAC but no response
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Use SPI to set MAC but no response
by xyj19911129 ·
[quote=“midnightcow”]Hi,
I wonder how to control CSC pin?
In FDM mode, CSC pin should be grounded(low).
And, After NRST goes high, You should wait until internal PLOCK is high. It will take over 1ms. (refer to datasheet 5.1.1)
Most of all, you should check to read 0x04 from the VERSIONR.
Thank you.[/quote]
Hello, midnightcow.
Thanks for your replying. And I’ve modified my program as you said.
To inlitiate the W5500, I set the NRST, used systick clock to wait about 100ms, and then wrote RST status to the MR register, waited about 100ms.
After initiating, I transmitted the MAC to W5500 and then asked for reply, using the function called “Write_Bytes(SHAR,array,6)” in the head file——W5500.h (in VDM model). However, only the first data I read form SPI->DR was correct, the following datas were all different from what I wrote, and were all the same, 0x03.
Thanks for your help!
RE: Use SPI to set MAC but no response
by xyj19911129 ·
[quote=“midnightcow”]Hi,
[quote]
What you did use in SPI Mode? FDM or VDM?
In FDM mode, As the above said, SCS don’t need to be control but tied with ground.
In VDM mode, SCS should be controlled by the data size to be write or read. Not tied with ground.
For WRITE example in VDM.
1. make SCS low
2. Write Address phase (0x0009) via MOSI
—2.1. Write 0x00 via MOSI & Read dummy via MISO
—2.2. Write 0x09 via MOSI & Read dummy via MISO
3. Write Control phase (Block Select, W/R, VDM) via MOSI
—3.1. Write 0x04 (Block=‘0000’, W/R=‘1’, Mode=‘00’) & Read dummy via MISO
4. Write Data phase(6bytes MAC) via MOSI
—4.1 Write 0x00 (mac[0]) & Read dummy via MISO
—4.2 Write 0x08 (mac[1]) & Read dummy via MISO
—4.3 Write 0xDC (mac[2]) & Read dummy via MISO
—4.4 Write 0x01 (mac[3]) & Read dummy via MISO
—4.5 Write 0x02 (mac[4]) & Read dummy via MISO
—4.6 Write 0x03 (mac[5]) & Read dummy via MISO
5. Make SCS high
For READ example in VDM.
1. make SCS low
2. Write Address phase (0x0009) via MOSI
—2.1. Write 0x00 via MOSI & Read dummy via MISO
—2.2. Write 0x09 via MOSI & Read dummy via MISO
3. Write Control phase (Block Select, W/R, VDM) via MOSI
—3.1. Write 0x00 (Block=‘0000’, W/R=‘0’, Mode=‘00’) & Read dummy via MISO
4. Write Data phase(6bytes MAC) via MOSI
—4.1 Write dummy & Read SHAR0(mac[0]) via MISO
—4.2 Write dummy & Read SHAR0(mac[1]) via MISO
—4.3 Write dummy & Read SHAR0(mac[2]) via MISO
—4.4 Write dummy & Read SHAR0(mac[3]) via MISO
—4.5 Write dummy & Read SHAR0(mac[4]) via MISO
—4.6 Write dummy & Read SHAR0(mac[5]) via MISO
5. Make SCS high
Note that SPI periphral of ST processes both MOSI & MOSI at once. Even if only write operation, You should read MISO and ignored it, vice versa.
Check the above sequence, plz.
If you can’t solve the problem, post the SPI captured file by osciloscope.
Thank you.[/quote][/quote]
Hi,midnightcow
It’s really nice of you to explain to me so explicitly.
Initially, I used FDM mode. After your tutoring, I changed it to VDM mode with Simulate SPI, and have got right result. Thank you!
However, when using real SPI, the result turned out to be wrong. But never mind, I’ll make it myself.
Thank you!
RE: Use SPI to set MAC but no response
by APK14 ·
hey,
I had a W5500 I/O connected to M66 device ,& I wanted to set the MAC add. of W5500 and check the response.
I used VDM mode ,For write data and data was:
0x00 0x09 0x04 0xEA, 0x11, 0x22, 0x33, 0x44, 0xEA.
But when read the mac address ,data was 00:00:00:00:00:00
so why can not get mac address?
Thank you