[solved]¿Ethernet Shield 2 How to make it work without pin 10 (SCSn)

Hello friends after reviewing the information that is available, I do not see anything that will ruin this.

Is it possible to use the Ethernet Shield by pulling the SCSn pin of the w5500 chip to negative?

According to the manufacturer's pdf the chip can work as it is now with the active signal from scsn controlled by the mega for example, but also putting it to negative and mode (Fixed Length Data Mode (SCSn is always connected by Ground)

I want to use the network module without the sd or any other device on the spi bus.
With which the selection pin would not be necessary.

I have not seen any library that set this up to work like this.
The SPI.h library does not have that mode.

Someone knows if there is a library or how to make it work without pin 10.

Greetings and thank you

the CS pin of the Wiznet chip is connected to pin 10 of the shield. so the only option on the shield is pin 10. you can bend the pin away from the underlying header of the board an connect it to some other pin or to ground. pin 53 must be OUTPUT if using SPI on Mega

Thanks for your answer, bending the pin is correct.
But what I want to do is that the w5500 is only on the bus and not
Do not use any pin like scsn.
According to the data sheet of the w55500 can be done.

So what are the libraries if the pin 10 of the mega does not connect with the scs of the w5500 the module w5500 does not work even if we pull the pin SCSn of the w5500 to negative.

FRAN2017:
Thanks for your answer, bending the pin is correct.
But what I want to do is that the w5500 is only on the bus and not
Do not use any pin like scsn.
According to the data sheet of the w55500 can be done.

So what are the libraries if the pin 10 of the mega does not connect with the scs of the w5500 the module w5500 does not work even if we pull the pin SCSn of the w5500 to negative.

connecting to ground/negative should work. use Ethernet.init(-1) in setup to disable use of any pin for CS

No, it does not work.

I'm using ethernet2.h

If I connect it to pin 10 of the mega it works.
But if I put the pin SCSn of the W5500 to negative including the line that indicates me, it does not work.

Thank you

FRAN2017:
No, it does not work.

I'm using ethernet2.h

If I connect it to pin 10 of the mega it works.
But if I put the pin SCSn of the W5500 to negative including the line that indicates me, it does not work.

Thank you

Don't use Ethernet2. It is obsolete some months now. Use the latest version of Ethernet library

Ok, I'm going to try.

Hi, I have updated and do the same.

With the pin set to 10 and connected it works.

If I set the w5500 to negative and put line Ethernet.init(-1) it does not work.

To make the test I have loaded the example: Webclient

can you post a photo of the pin 10 'patch'?

A photo of the board or what part?

It is very simple or I connect the w5500 to the mega or I remove the pin 10 of the w5500 and connect it to negative.

try to connect it to pin 53 and use it as SS.

Is it a problem to make a photo?

I change the pin and I take a photo no problem.

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.

the -1 is only a dummy CS pin number for the Ethernet library. the library uses it with pinMode and digitalWrite calls and they ignore -1. if the wiznet chip requires the change from HIGH to LOW, then this will not work

with 53 it works?

btw: you can patch the pin 10 from female side of the shield's header

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.

I do not know how to do it, I'm lost.

FRAN2017's issue report:

I don't find anything in the Ethernet library's code that does special handling of Ethernet.init(-1). I haven't taken a detailed look at what this would do with the variant and core code, but it seems the use of that pin number might result in undefined behavior.

It is that I do not know how to say to the w5500, that it has to work in FDM mode, with the OM bits [1: 0],

The Ethernet.init (-1) option does not work.

Please allow me to answer your question with clarity and certainty. I am the author of the recent Ethernet changes. I believe I can speak with very good confidence about how the chip select code in Ethernet 2.0.0 works, since I wrote it.

No. The answer is no.

Ethernet.init(-1) is definitely NOT supported.

I can also tell you I have absolutely no plans to ever add this support to the Ethernet library. My opinion is it's a rather risky feature, so even if someone did write this code, I would be quite reluctant to merge it to the Ethernet library which is published for general usage for all Arduino users.

Please, accept no as the answer. Do not ask me to write this code. I will not do it. I am very familiar with the W5500 chip and its datasheet, so you do not need to explain this feature to me. I know about this hardware capability in the W5500 chip. I have made an conscious & informed decision never to support it in the Ethernet library.

But if you wish to write this code, you certainly are welcome to fork the library. That is the beauty of open source. But please do not ask me for help. I will not assist. And once more, even if you do write this code and get it working with specific hardware, the odds of ever seeing it merged into the Arduino Ethernet library are slim.

However, I am willing to do one thing. If you have found any documentation that is unclear or ambiguous, which might have suggested to you the possibility of using Ethernet.init(-1), please be specific about where you saw such info. I would very much like to improve the documentation. If it is unclear in any way, I want to make sure nobody ever is given the false impression that Ethernet might support using a negative number for the CS pin.

Thank you very much for your response, clear and concise.

We all learn something new every day.

Thank you very much everyone for your time.