Raspberry pi Pico + WIZ850io(W5500) 하드웨어 연결
SPI1_SCK ----> WIZ850io SCLK
SPI1_TX ----> WIZ850io MOSI
SPI1_RX ----> WIZ850io MISO
SPI1_CSn ----> WIZ850io SCNn
GP15 ----> WIZ850io RSTn
3.3V, GND
1. pico-W5500 Library 다운로드
https://github.com/bjnhur/Adafruit_CircuitPython_Wiznet5k
상기 링크에서 하기 파일들을 다운로드하여 lib에 복사
- adafruit_wiznet5k
- adafruit_bus_device
- adafruit_request.mpy
2. IP address Ping Test
code.py source code
import board import busio import digitalio import time from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K SPI1_SCK = board.GP10 SPI1_TX = board.GP11 SPI1_RX = board.GP12 SPI1_CSn = board.GP13 W5500_RSTn = board.GP15 print("Wiznet5k Ping Test (no DHCP)") # Setup your network configuration below # random MAC, later should change this value on your vendor ID MY_MAC = (0x00, 0x01, 0x02, 0x03, 0x04, 0x05) IP_ADDRESS = (192, 168, 0, 100) SUBNET_MASK = (255, 255, 0, 0) GATEWAY_ADDRESS = (192, 168, 0, 1) DNS_SERVER = (8, 8, 8, 8) led = digitalio.DigitalInOut(board.GP25) led.direction = digitalio.Direction.OUTPUT ethernetRst = digitalio.DigitalInOut(W5500_RSTn) ethernetRst.direction = digitalio.Direction.OUTPUT # For Adafruit Ethernet FeatherWing cs = digitalio.DigitalInOut(SPI1_CSn) # For Particle Ethernet FeatherWing # cs = digitalio.DigitalInOut(board.D5) spi_bus = busio.SPI(SPI1_SCK, MOSI=SPI1_TX, MISO=SPI1_RX) # Reset W5500 first ethernetRst.value = False time.sleep(1) ethernetRst.value = True # Initialize ethernet interface with DHCP # eth = WIZNET5K(spi_bus, cs) # Initialize ethernet interface without DHCP eth = WIZNET5K(spi_bus, cs, is_dhcp=False, mac=MY_MAC) # Set network configuration eth.ifconfig = (IP_ADDRESS, SUBNET_MASK, GATEWAY_ADDRESS, DNS_SERVER) print("Chip Version:", eth.chip) print("MAC Address:", [hex(i) for i in eth.mac_address]) print("My IP address is:", eth.pretty_ip(eth.ip_address)) while True: led.value = not led.value time.sleep(1) print("Done!") |
192.168.0.100
IP 설정 코드를 PC와 통신 되는 환경에 맞게 수정
3. REPL 환경 설정
Putty를 통해 Serial Terminal 실행
3-1 COM port는 장치 관리자에서 확인
Raspberry Pi Pico + WIZ850io(W5500) Ethernet
Thank you.
'IT' 카테고리의 다른 글
AX2 - WIZnet TCP/UDP 속도 측정 Tool (0) | 2021.07.09 |
---|---|
W5500 Ethernet Shield(Raspberry Pi Pico) 서버 + Wizfi360 WiFi Module (Raspberry Pi Pico)클라이언트 온도 측정 데이터 전달 (0) | 2021.06.17 |
라즈베리 파이 피코 Raspberry Pi Pico + WizFi360-EVB-Mini 로 WiFi Network 구축 (0) | 2021.06.15 |
WizFi360-EVB-Mini 무선 모듈 + AT command (0) | 2021.06.08 |
Raspberry Pi Pico + WIZ850io(W5500) Ethernet 환경 구성하기 - (1) (0) | 2021.06.03 |