各位大佬好,发现以太网芯片 W5500 需要比较长的时间(接近 3秒 )才能 连接上, 以下是参考代码,有什么办法改善,谢谢!
class Ethernet():
def __init__(self, max_try = 50,debug = False):
spi = SPI(1, SPI.MASTER, baudrate = 20000_000) # baudrate 20000000 bps
cs = Pin('E_SS', mode= Pin.OUT)
rst =Pin('E_RST', mode= Pin.OUT)
rst.value(0)
delay(10)
rst.value(1)
self._debug = debug
self._run = False
nic = network.WIZNET5K(spi, cs, rst)
nic.active(False)
nic.active(True)
if dhcp == True:
nic.ifconfig('dhcp')
else:
nic.ifconfig((IP_ADDRESS, SUBNET_MASK, GATEWAY_ADDRESS, DNS_SERVER))
cnt = 0
while not nic.isconnected(): # wait connected
cnt = cnt + 1
utime.sleep_ms(50)
if max_try is not None and cnt >= max_try:
if self._debug:
print("Couldn't establish a connection!\r\n")
break
W5500 链接速度慢
-
- 随机主题
- 回复总数
- 阅读次数
- 最新文章
-
- 1回复总数
- 2791 阅读次数
- 最新文章 由 shaoziyang
2020年 12月 25日 09:35
-
- 1回复总数
- 2894 阅读次数
- 最新文章 由 shaoziyang
2020年 12月 25日 09:43
-
- 8回复总数
- 2251 阅读次数
- 最新文章 由 zwjiang
2020年 12月 26日 16:37