From c27341ab9946e9771ac2efd76f7379a38238aa01 Mon Sep 17 00:00:00 2001 From: BiffoBear Date: Thu, 27 Apr 2023 03:29:06 +0300 Subject: [PATCH] Added explicit soft reset for w5500 initialisation. --- adafruit_wiznet5k/adafruit_wiznet5k.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adafruit_wiznet5k/adafruit_wiznet5k.py b/adafruit_wiznet5k/adafruit_wiznet5k.py index 62f8085..ecaec1e 100644 --- a/adafruit_wiznet5k/adafruit_wiznet5k.py +++ b/adafruit_wiznet5k/adafruit_wiznet5k.py @@ -481,6 +481,11 @@ def _detect_and_reset_w5500() -> bool: """ self._chip_type = "w5500" # assert self.sw_reset() == 0, "Chip not reset properly!" + self._write_mr(0x80) + time.sleep(0.05) + if self._read_mr()[0] & 0x80: + return False + self._write_mr(0x08) # assert self._read_mr()[0] == 0x08, "Expected 0x08." if self._read_mr()[0] != 0x08: