Add photo set.
One question, the configuration Ethernet.init (-1) have you tried it and it worked for you?
I have reviewed all the libraries and I do not see anywhere the coding that under the condition Ethernet.init (-1) configure the w5500 to work with the pin SCSn to negative.
in the data sheet it states that the configuration bits: OM1 OM0 have these possible values
SPI Operation Mode Bits
This sets the SPI Operation Mode.
SPI Operation Mode supports two modes, the Variable Length Data
Mode and the Fixed Length Data Mode.
HOW IT WORKS NOW ----------------------------------------------- ---
- Variable Length Data Mode (VDM)
Data Length is controlled by SCSn.
External Host makes SCSn Signal Assert (High-to-Low) and reports
The start of the SPI Frame Address Phase to W5500.
Then the external host transfers the Control Phase with
OM [1: 0] = "00".
After N-Bytes Data Phase transfers, SCSn Signal is De-asserted
(Low-to-High) and informs the end of the SPI Frame Data Phase to
W5500.
In VDM Mode, the SCS must be controlled with SPI Frame unit by
the External Host. (Refer to the Figure 4)
HOW WE WANT IT TO WORK --------------------------------------------
- Fixed Length Data Mode (FDM)
In FDM, the Data Length is set by OM [1: 0], these are not "00"
value So, the SCSn signal should be Low state, and has one
Length type (among 1 Bytes, 2 Bytes, 4 Bytes) according to the
OM [1: 0] value. (Refer to the Figure 5.)
The next table shows the SPI Operation Mode according to the
OM [1: 0].
OM [1: 0] Meaning
00 Variable Data Length Mode, N-Bytes Data Phase (1 ≤ N) <------------------------HOW IT WORKS NOW
01 Fixed Data Length Mode, 1 Byte Data Length (N = 1)<------HOW WE WANT IT TO WORK
10 Fixed Data Length Mode, 2 Byte Data Length (N = 2)<------HOW WE WANT IT TO WORK
11 Fixed Data Length Mode, 4 Byte Data Length (N = 4)<------HOW WE WANT IT TO WORK
Fixed Length Data Mode (FDM)
The FDM mode can be used when the External Host cannot control SCSn signal.
The SCSn signal should be tied to Low (Always connected to GND) and it is not
possible to share the SPI Bus with other SPI Devices. (Refer to the Figure 5.)
In VDM mode, Data Phase length is controlled by SCSn control.
But in FDM mode, Data Phase length is controlled by OM[1:0] value (‘01’ / ‘10’ / ‘11’)
which is the SPI Operation Mode Bits of the Control Phase.
As the SPI Frame of FDM mode is the same as SPI Frame of VDM mode (1Byte, 2
Bytes, 4 Bytes SPI Frame) except for the SCSn signal control and OM[1:0] setting, the
detail about FDM mode is not described in this section.
It is not recommended to use the FDM mode unless you are in inevitable status. In
addition, we use only 1/2/4 Bytes SPI Frame, as described in ‘Chapter 2.4.1’ &
‘Chapter 2.4.2’. Using SPI Frame with other length of Data will cause malfunction of
W5500.
I have not found where you set it to work in the modes:
01
10
11
I think if you do not configure these bits (OM) correctly it will not work.
Connecting the pin scs of the w5500 to pin 53 of the mega and defining Ethernet.init(-1) does not work.
Defining Ethernet.init(53) if that works.