Skip to content

Commit

Permalink
Merge pull request #111 from BiffoBear/fix_w5500_reset
Browse files Browse the repository at this point in the history
Added explicit soft reset for w5500 initialisation.
  • Loading branch information
FoamyGuy authored Apr 29, 2023
2 parents a4b08db + c27341a commit 05224ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions adafruit_wiznet5k/adafruit_wiznet5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 05224ce

Please sign in to comment.