3.2 Socket Register Block W5500 supports 8 Sockets for communication channel. Each Socket is controlled by Socket n Register Block(when 0≤n≤7). The n value of Socket n Register can be selected by BSB[4:0] of SPI Frame.
defines the 16bits Offset Address of registers in Socket n Register Block. Refer to „Chapter 4.2‟ for more details about each register. Table 4.3.3 Memory W5500 has one 16KB TX memory for Socket n TX Buffer Blocks and one 16KB RX memory for Socket n RX buffer Blocks. 16KB TX memory is initially allocated in 2KB size for each Socket TX Buffer Block (2KB X 8 = 16KB). The initial allocated 2KB size of Socket n TX Buffer can be reallocated by using „Socket n TX Buffer Size Register (Sn_TXBUF_SIZE)‟.
4 Register Descriptions 4.1 Common Registers MR (Mode Register) [R/W] [0x0000] [0x00] 2 MR is used for S/W reset, ping block mode and PPPoE mode. 7 6 5 4 3 2 1 0 RST Reserved WOL PB PPPoE Reserved FARP Reserved Bit Symbol 7 RST 6 Reserved Description If this bit is „1‟, All internal registers will be initialized. It will be automatically cleared as „0‟ after S/W reset.
0 : Disable Force ARP mode 1 : Enable Force ARP mode In Force ARP mode, It forces on sending ARP Request whenever data is sent. 0 Reserved Reserved GAR (Gateway IP Address Register) [R/W] [0x0001 – 0x0004] [0x00] GAR configures the default gateway address. Ex) In case of “192.168.0.1” 0x0001 0x0002 0x0003 0x0004 192 (0xC0) 168 (0xA8) 0 (0x00) 1 (0x01) SUBR (Subnet Mask Register) [R/W] [0x0005 – 0x0008] [0x00] SUBR configures the subnet mask address. Ex) In case of “255.255.255.
INTLEVEL (Interrupt Low Level Timer Register) [R/W] [0x0013 – 0x0014] [0x0000] INTLEVEL configures the Interrupt Assert Wait Time (IAWT). When the next interrupt occurs, Interrupt PIN (INTn ) will assert to low after INTLEVEL time. 𝐼𝐴𝑊𝑇 = (𝐼𝑁𝑇𝐿𝐸𝑉𝐸𝐿 + 1) × 𝑃𝐿𝐿𝐶𝐿𝐾 × 4 (when INTLEVEL > 0) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 PLL_CLK SIR 0x0000 0x0001 S0_IR 0x00 0x04 S1_IR 0x00 0x0003 0x0002 0x00 b. 0x01 a. c. IAWT d. INTn Figure 21. INTLEVEL Timing a.
IR (Interrupt Register) [R/W] [0x0015] [0x00] IR indicates the interrupt status. Each bit of IR will be still „1‟ until the bit will be written to „1‟ by the host. If IR is not equal to „0x00‟, INTn PIN is asserted low until it is „0x00‟. 7 6 CONFLICT Bit UNREACH 5 PPPoE 4 MP Symbol 3 Reserved 2 Reserved 1 Reserved 0 Reserved Description IP Conflict 7 CONFLICT Bit is set as „1‟ when own source IP address is same with the sender IP address in the received ARP request.
IMR (Interrupt Mask Register) [R/W][0x0016][0x00] IMR is used to mask interrupts. Each bit of IMR corresponds to each bit of IR. When a bit of IMR is „1‟ and the corresponding bit of IR is „1‟, an interrupt will be issued. In other words, if a bit of IMR is „0‟, an interrupt will not be issued even if the corresponding bit of IR is „1‟.
SIR (Socket Interrupt Register) [R/W] [0x0017] [0x00] SIR indicates the interrupt status of Socket. Each bit of SIR be still „1‟ until Sn_IR is cleared by the host. If Sn_IR is not equal to „0x00‟, the n-th bit of SIR is „1‟ and INTn PIN is asserted until SIR is „0x00‟. 7 6 5 4 3 2 1 0 S7_INT S6_INT S5_INT S4_INT S3_INT S2_INT S1_INT S0_INT Bit Symbol 7 Description When the interrupt of Socket n occurs, the n-th bit of SIR becomes ~ Sn_INT „1‟.
RTR (Retry Time-value Register) [R/W] [0x0019 – 0x001A] [0x07D0] RTR configures the retransmission timeout period. The unit of timeout period is 100us and the default of RTR is „0x07D0‟ or „2000‟. And so the default timeout period is 200ms(100us X 2000). During the time configured by RTR, W5500 waits for the peer response to the packet that is transmitted by Sn_CR(CONNECT, DISCON, CLOSE, SEND, SEND_MAC, SEND_KEEP command).
the TCP packet is retransmitted. The retransmission is repeated as many as „RCR+1‟. Even after TCP retransmission is repeated as „RCR+1‟ and there is no response to the TCP retransmission, the final timeout is occurred and Sn_IR(TIMEOUT) becomes „1‟. The time of final timeout (TCPTO) of TCP retransmission is as below. 𝑀 𝑇𝐶𝑃𝑇𝑂 = (∑(𝑅𝑇𝑅 × 2𝑁 ) + ((𝑅𝐶𝑅 − 𝑀) × 𝑅𝑇𝑅𝑀𝐴𝑋 )) × 0.
PHAR (Destination Hardware Address Register in PPPoE mode) [R/W] [0x001E-0x0023] [0x0000] PHAR should be written to the PPPoE server hardware address acquired in PPPoE connection process Ex) In case that destination hardware address is 00:08:DC:12:34:56 0x001E 0x001F 0x0020 0x0021 0x0022 0x0023 0x00 0x08 0xDC 0x12 0x34 0x56 PSID (Session ID Register in PPPoE mode) [R/W] [0x0024-0x0025] [0x0000] PSID should be written to the PPPoE sever session ID acquired in PPPoE connection process.
UIPR (Unreachable IP Address Register) [R] [0x0028-0x002B] [0x00000000] UPORTR (Unreachable Port Register) [R] [0x002C-0x002D] [0x0000] W5500 receives an ICMP packet(Destination port unreachable) when data is sent to a port number which socket is not open and UNREACH bit of IR becomes „1‟ and UIPR & UPORTR indicates the destination IP address & port number respectively. Ex) In case of “192.168.0.
PHYCFGR (W5500 PHY Configuration Register) [R/W] [0x002E] [0b10111XXX] PHYCFGR configures PHY operation mode and resets PHY. In addition, PHYCFGR indicates the status of PHY such as duplex, Speed, Link. Bit Symbol Description Reset [R/W] 7 RST When this bit is ‘0’, internal PHY is reset. After PHY reset, it should be set as ‘1’.
VERSIONR (W5500 Chip Version Register) [R] [0x0039] [0x04] VERSIONR always indicates the W5500 version as 0x04. W5500 Datasheet Version1.
4.2 Socket Registers Sn3_MR (Socket n Mode Register) [R/W] [0x0000] [0x00] Sn_MR configures the option or protocol type of Socket n. 7 MULTI/ MFEN Bit 6 BCASTB 5 4 ND / MC UCASTB /MMB MIP6B Symbol 3 2 1 0 P3 P2 P1 P0 Description Multicasting in UDP mode 0 : disable Multicasting 1 : enable Multicasting This bit is applied only during UDP mode(P[3:0] = „0010‟).
Data packet is received from a peer. When this bit is „0‟, It sends the ACK packet after waiting for the timeout time configured by RTR. Multicast 0 : using IGMP version 2 1 : using IGMP version 1 This bit is applied only during UDP mode(P[3:0] = „0010‟) and MULTI = „1‟. It configures the version for IGMP messages (Join/Leave/Report). Multicast Blocking in MACRAW mode 0 : disable Multicast Blocking 1 : enable Multicast Blocking This bit is applied only when MACRAW mode(P[3:0] = „0100‟).
Sn_CR (Socket n Command Register) [R/W] [0x0001] [0x00] This is used to set the command for Socket n such as OPEN, CLOSE, CONNECT, LISTEN, SEND, and RECEIVE. After W5500 accepts the command, the Sn_CR register is automatically cleared to 0x00. Even though Sn_CR is cleared to 0x00, the command is still being processed. To check whether the command is completed or not, please check the Sn_IR or Sn_SR.
In these cases, Sn_SR is changed to SOCK_CLOSED. Valid only in TCP mode. Regardless of „TCP server‟ or „TCP client‟, the DISCON command processes the disconnect-process („Active close‟ or „Passive close‟). Active close: it transmits disconnect-request(FIN packet) to the connected peer Passive close: When FIN packet is received from peer, a FIN packet is replied back to the peer.
RECV completes the processing of the received data in Socket n RX Buffer by using a RX read pointer register (Sn_RX_RD). 0x40 RECV For more details, refer to Socket n RX Received Size Register (Sn_RX_RSR), Socket n RX Write Pointer Register (Sn_RX_WR), and Socket n RX Read Pointer Register (Sn_RX_RD). Sn_IR (Socket n Interrupt Register) [R] [0x0002] [0x00] Sn_IR indicates the status of Socket Interrupt such as establishment, termination, receiving data, timeout).
Sn_SR (Socket n Status Register) [R] [0x0003] [0x00] Sn_SR indicates the status of Socket n. The status of Socket n is changed by Sn_CR or some special control packet as SYN, FIN packet in TCP. Value Symbol 0x00 SOCK_CLOSED Description This indicates that Socket n is released. When DICON, CLOSE command is ordered, or when a timeout occurs, it is changed to SOCK_CLOSED regardless of previous status. 0x13 SOCK_INIT This indicates Socket n is opened with TCP mode.
0x02 SOCK_MACRAW This indicates Socket 0 is opened in MACRAW mode (S0_MR(P[3:0]) = „0100‟)and is valid only in Socket 0. It changes to SOCK_MACRAW when S0_MR(P[3:0] = „0100‟ and OPEN command is ordered. Like UDP mode socket, MACRAW mode Socket 0 can transfer a MAC packet (Ethernet frame) without the connectionprocess. The following table shows a temporary status indicated during changing the status of Socket n.
Sn_PORT (Socket n Source Port Register) [R/W] [0x0004-0x0005] [0x0000] Sn_PORT configures the source port number of Socket n. It is valid when Socket n is used in TCP/UPD mode. It should be set before OPEN command is ordered.
Sn_DIPR (Socket n Destination IP Address Register) [R/W] [0x000C-0x000F] [0x00000000] Sn_DIPR configures or indicates the destination IP address of Socket n. It is valid when Socket n is used in TCP/UDP mode. In TCP client mode, it configures an IP address of „TCP server‟ before CONNECT command. In TCP server mode, it indicates an IP address of „TCP client‟ after successfully establishing connection. In UDP mode, it configures an IP address of peer to be received the UDP packet by SEND or SEND_MAC command.
Sn_MSSR (Socket n Maximum Segment Size Register) [R/W] [0x0012-0x0013] [0x0000] Sn_MSSR configures or indicates the MTU(Maximum Transfer Unit) of Socket n. The default MTU is valid when Socket n is used in TCP / UDP mode. However, when in PPPoE mode(MR[PPPoE] = „1‟), it is determined within PPPoE MTU.
Sn_TTL (Socket n TTL Register) [R/W] [0x0016] [0x80] Sn_TTL configures the TTL(Time To Live field in IP header) of Socket n. It is set before OPEN command. For more the details, refer to http://www.iana.org/assignments/ip-parameters. Sn_RXBUF_SIZE (Socket n RX Buffer Size Register) [R/W] [0x001E] [0x02] Sn_RXBUF_SIZE configures the RX buffer block size of Socket n. Socket n RX Buffer Block size can be configured with 1,2,4,8, and 16 Kbytes.
Socket n TX Buffer Block can be accessible with 16bits Offset Address ranged from 0x0000 to 0xFFFF regardless of the configured size. (Refer to Sn_TX_WR & Sn_TX_RD). Value (dec) 0 1 2 4 8 16 Buffer size 0KB 1KB 2KB 4KB 8KB 16KB Ex) Socket 0 TX Buffer Size = 4KB 0x001F 0x04 Sn_TX_FSR (Socket n TX Free Size Register) [R] [0x0020-0x0021] [0x0800] Sn_TX_FSR indicates the free size of Socket n TX Buffer Block. It is initialized to the configured size by Sn_TXBUF_SIZE.
value 0xFFFF, (greater than 0x10000 and the carry bit occurs), then the carry bit is ignored and will automatically update with the lower 16bits value. Sn_TX_WR (Socket n TX Write Pointer Register) [R/W] [0x0024-0x0025] [0x0000] Sn_TX_WR is initialized by OPEN command. However, if Sn_MR(P[3:0]) is TCP mode(„0001‟), it is re-initialized while connecting with TCP. It should be read or to be updated like as follows. 1. Read the starting address for saving the transmitting data. 2.
Ex) In case of 2048(0x0800) in S0_RX_RD, 0x0028 0x0029 0x08 0x00 Sn_RX_WR (Socket n RX Write Pointer Register) [R] [0x002A-0x002B] [0x0000] Sn_RX_WR is initialized by OPEN command and it is auto-increased by the data reception. If the increased value exceeds the maximum value 0xFFFF, (greater than 0x10000 and the carry bit occurs), then the carry bit is ignored and will automatically update with the lower 16bits value.
Sn_FRAG (Socket n Fragment Register) [R/W] [0x002D-0x002E] [0x4000] Sn_FRAG configures the FRAG(Fragment field in IP header). Ex) Sn_FRAG0 = 0x0000 (Don‟t Fragment) 0x002D 0x002E 0x00 0x00 Sn_KPALVTR (Socket n Keep Alive Time Register) [R/W] [0x002F] [0x00] Sn_KPALVTR configures the transmitting timer of „KEEP ALIVE(KA)‟ packet of SOCKETn. It is valid only in TCP mode, and ignored in other modes. The time unit is 5s.
5 Electrical Specifications 5.1 Absolute Maximum Ratings Symbol Parameter Rating Unit VDD DC Supply voltage -0.5 to 4.6 V VIN DC input voltage -0.5 to 6 V DC output voltage -0.5 to 4.6 V IIN DC input current 5 mA TOP Operating temperature -40 to +85 C TSTG Storage temperature -65 to +150 C VOUT *COMMENT: Stressing the device beyond the „Absolute Maximum Ratings‟ may cause permanent damage. 5.
5.3 DC Characteristics (Test Condition: Ta = –40 to 85°C) Symbol Parameter VDD Supply voltage VIH High level input Test Condition Apply VDD, AVDD Min Typ Max Unit 2.97 3.3 3.63 V 2.0 5.5 V - 0.3 0.8 V voltage VIL Low level input voltage VT Threshold point All inputs except XI 1.30 1.41 1.53 V VT+ Schmitt trig Low to All inputs except XI 1.53 1.64 1.73 V All inputs except XI 0.95 1.02 1.
5.4 Power Dissipation (Test Condition: VDD=3.3V, AVDD=3.3V, Ta = 25°C) Condition Min Typ Max Unit 100M Link - 128 - mA 10M Link - 75 - mA Un-Link (Auto-negotiation mode) - 65 - mA 100M Transmitting - 132 - mA 10M Transmitting - 79 - mA Power Down mode - 13 - mA 5.5 AC Characteristics 5.5.1 Reset Timing TRC RSTn TPL PLOCK (Internal) Figure 22. Reset Timing Symbol 5.5.
5.5.4 SPI Timing TCS SCSn VIH VIL TCSS SCLK TCSH VIH TWH VIL TDS MOSI TWL TDH VIH VIL TOV MISO VOH VOL TOH TCHZ HI-Z HI-Z Figure 23. SPI Timing Symbol 4 Description Min Max 80/33.
5.5.5 Transformer Characteristics Parameter Transmit End Receive End Turn Ratio 1:1 1:1 Inductance 350 uH 350 uH Figure 24. Transformer Type 5.5.6 MDIX W5500 does not support auto-MDIX feature. Thus, user should use straight-through cables to connect to other switches or routers and crossover cables to connect to devices such as servers, workstations or another W5500.
6 Package Descriptions Note 1. These dimensions do not include mold protrusion. 2. ( ) is reference. 3. [ ] is ass‟y out quality. 4. UNIT: mm Figure 25. Package Dimensions 64 / 65 W5500 Datasheet Version1.
Document History Information Version Date Ver. 1.0 1AUG2013 Descriptions Initial Release Copyright Notice Copyright 2013 WIZnet Co., Ltd. All Rights Reserved. Technical Support: support@wiznet.co.kr Sales & Distribution: sales@wiznet.co.kr For more information, visit our website at http://www.wiznet.co.kr W5500 Datasheet Version1.