---
title: "Set lan speed with 10M problem"
url: "https://maker.wiznet.io/forum/12080"
markdown_url: "https://maker.wiznet.io/forum/12080/md"
type: "Forum topic"
category: "MCU & Boards"
author: "k8051"
created: "2017-01-05T09:42:10+09:00"
last_activity: "2017-05-04T08:39:35+09:00"
language: "en"
views: 705
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Set lan speed with 10M problem

## Question

Asked by k8051 on 2017-01-05 in MCU & Boards.

I have download the sample code from official Library and Peripheral Example.

I want to set lan speed with 10M problem with set_link function in W7500x_miim.c but it have not update

control register and also is 100M. I read the PHYREG_CONTROL is not equal to I wrote.

I have reference [wizwiki.net/wiki/lib/exe/fetch.p … erence.pdf](http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w7500p:w7500p_phy_reference.pdf) but can not solve problem.

Any one have same problem? have any suggestion to me?

## Replies

### Reply 1 by Wisse, 2017-01-05

I use mdio_write to change the speed:

```
mdio_write(GPIOB, 0, 0x0100);	// 10MBs full duplex
```

Also be sure the mii link is correct!! phy_id does a check if return data is not 0, but forgets to check if data == 0xFFFF
For me this solved a lot of problems.

```
int32_t phy_id(void)
{
    ...... All settings in miim.c
					 
        printf("PHY_ID = %d , STATUS = %x\r",i,data);  //Should be someting like: 0x7869		
	
        if(data != 0 && data != 0xFFFF) return i; // !!!! Check if data isn't all 1's!
        }
    printf("[PHY]:ID detect error!!\r\n");
    }
    return 0;
}
```

### Reply 2 by k8051, 2017-01-06

Thank you Wisse reply.

I solved the problem with Wisse suggests.

Thank you!

---

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