---
title: "RJ45 and W5100"
url: "https://maker.wiznet.io/forum/9547"
markdown_url: "https://maker.wiznet.io/forum/9547/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "beirao"
created: "2013-09-23T19:37:05+09:00"
last_activity: "2017-05-04T08:30:10+09:00"
language: "en"
views: 739
replies: 18
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# RJ45 and W5100

## Question

Asked by beirao on 2013-09-23 in Ethernet Chips.

Hi,

I´m trying to do a ping between W5100 and my computer. I use a PIC18F with SPI communication with W5100.

My comunication between PIC and W5100 is right: I send and receive the right values. But, when I connect the plug RJ45 is the same as not plug: nothing happens! The lights not turn on, nothing.

Any suggestion? My plug is connected how this document: [wiznet.co.kr/UpLoad_Files/Re … otcamp.pdf](http://www.wiznet.co.kr/UpLoad_Files/ReferenceFiles/W5100_bootcamp.pdf)

Thank you!

## Replies

### Reply 1 by hjjeon0608, 2013-09-24

Hi Beirao.

I want to receive your own schematic.
When you connect cable to RJ45, link led should be turned on although communication doesn’t work.

Best regards.

### Reply 2 by beirao, 2013-09-24

[quote=“hjjeon0608”]Hi Beirao.

I want to receive your own schematic.
When you connect cable to RJ45, link led should be turned on although communication doesn’t work.

Best regards.[/quote]

Hi,

Thank you for your answer. My plug connections is: [dl.dropboxusercontent.com/u/796 … c_RJ45.jpg](https://dl.dropboxusercontent.com/u/7968620/schematic_RJ45.jpg)

I send values of common registers, and the values read is correct; but, I don´t can do ping…

After, if I don´t can socket initialization, because condition Sn_SR(0) != SOCK_UDP is true.

Any suggestion? Thank you.

### Reply 3 by beirao, 2013-09-24

I had a problem in components: I used a 16MHz crystal, and not a 25 MHz. With this alteration, I can do ping!

But, can´t initialize socket yet…

In this momment, when I initialize the socket (UDP), the register Sn_SR is always 0x01 (SOC_ARP). Why? ![:wink:](https://emoji.discourse-cdn.com/twitter/wink.png?v=12)

### Reply 4 by hjjeon0608, 2013-09-25

Hi, beirao.

Let me know your whole procedures.

You mean initialization is Sn_CR is OPEN(0x01) or else??
If you set Sn_MR as UDP mode, your Sn_SR = ARP is not correct.
ARP is only in TCP mode connection request or UDP mode send data.

Also, that the status(ARP) is not changed means your network has problem.
Although you don’t set correctly, W5100 should receive ARP reply. But your W5100 send ARP request but don’t receive ARP reply.

Please, check in detail and tell me your condition.

Best regards.

### Reply 5 by beirao, 2013-09-25

Hi,

the problem is my laptop. Now, I conect a router and works!

Thank you!

### Reply 6 by beirao, 2013-09-25

Hi,

When I do a CONNECT stage, I write the Destination IP Address, but if I read this value, value is zero. Any suggestion? MY function for write the values is correct, because works in previous registers.

### Reply 7 by hjjeon0608, 2013-09-26

Hi, beirao.

It is normal.
Destination information(e.g. dst IP, MAC and etc.) is not changed immediately.
After connection(in TCP mode) or send data(in UDP mode), you can read right value.

Try to check after connection.

Best regards.

### Reply 8 by beirao, 2013-09-26

Hi,

Thanks for your answer ![:wink:](https://emoji.discourse-cdn.com/twitter/wink.png?v=12)

### Reply 9 by beirao, 2013-09-26

Hi,

The connection does not stabilize (after connection stage). My configurations, in Laptop, are:
[dl.dropboxusercontent.com/u/796 … 20Copy.jpg](https://dl.dropboxusercontent.com/u/7968620/Untitled%20-%20Copy.jpg)

I have any configuration wrong?

### Reply 10 by hjjeon0608, 2013-09-30

Hi, beirao

What is the symptom.
Please, describe in detail.(your procedure, W5100’s status and etc.)

Best regards.

### Reply 11 by beirao, 2013-09-30

[quote=“hjjeon0608”]Hi, beirao

What is the symptom.
Please, describe in detail.(your procedure, W5100’s status and etc.)

Best regards.[/quote]

Hi,

In TCP Client mode, after do CONNECT stage, the Sn_CR(0) is equal a SOCK_CLOSED.
I´m writting the IP and other values, and communicate the PC to W5100 between router…

### Reply 12 by hjjeon0608, 2013-10-01

Hi, beirao.

If W5100 didn’t get IP from DHCP server or router which doesn’t support NAT, you cannot connect PC to W5100 between router. Private IP need to change to public IP.
I think you set IP address of W5100 as private IP.
Please, try to ping from PC to W5100. If cannot ping, you need to get public IP or DHCP server or router which support NAT.

Best regards.

### Reply 13 by beirao, 2013-10-01

Thank you a lot for your attention. My connection works now! ![:wink:](https://emoji.discourse-cdn.com/twitter/wink.png?v=12)

Another questions:

- what it the “source_addr” in Sending Process on TCP connection? The transmition data starts in get_start_addres, right? So, I don´t understand what is “source_addr”.

- How to check the “LAST-ACK?” ? By Sn_SR = SOCK_CLOSE_WAIT?

- How to check the “Disconnect?” ? By Sn_SR = SOCK_CLOSE_WAIT?

Both conditions are not in datasheet.

Thank you!

### Reply 14 by hjjeon0608, 2013-10-02

Hi, beirao.

Source address is my address. In other word, address of W5100.
And I don’t understand

![](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/48.png) beirao:

> The transmition data starts in get_start_addres, right?

Please, explain in more detail.

> How to check the “LAST-ACK?” ? By Sn_SR = SOCK_CLOSE_WAIT?

What do you mean LAST-ACK?? SOCK_CLOSE_WAIT is w5100 received connection termination request from peer host.
And if connection is closed, Sn_SR is 0x00(SOCK_CLOSED).

Best regards.

### Reply 15 by beirao, 2013-10-02

Hi,

Thanks for your answer.

In TCP Client mode, page 48 “5.2.1.2 CLIENT mode” in W5100 datasheet, there is a “LAST-ACK?” after the “Sending Process” and/or “Send DATA?”. So, how do I verify this condition?

Thank you.

### Reply 16 by hjjeon0608, 2013-10-04

Hi, beirao.

The picture is hardware flow.
And ‘LAST-ACK’ is ack about sending FIN packet.

1. Server : sending FIN.

2. Client : receiving FIN and sending ACK, FIN

3. Server : receiving ACK/FIN, sending ACK

4. Client : receiving ACK. &lt;----------- this is LAST-ACK.

The number 1, 2, 3 are hidden in the flow chart.
And this stage is to check receiving close request.

This is managing automatically inside W5100, so you don’t have to check receiving LAST-ACK.

Best regards.

### Reply 17 by beirao, 2013-10-05

Hi,

Thanks for your answer.

So, in my firmware (for CLIENT MODE) after the “Sending Process” stage, what I should do? Disconnect or wait for timeout?

Thank you very much!

### Reply 18 by hjjeon0608, 2013-10-07

Hi, beirao.

You need to design your own application.

Application is very variable. So, we cannot define.

We provide just example code such as loopback to user to use our chip easily.

Best regards.

---

Source: https://maker.wiznet.io/forum/9547
