Skip to content

Commit

Permalink
v1.0.9
Browse files Browse the repository at this point in the history
#### New in v1.0.9

1. Add EthernetWrapper.h for easier W5x00 support as well as more Ethernet libs in the future.
2. Add default SS/CS pin for ESP8266 and ESP32
3. Increase default clock speed for W5x00 in Ethernet and EthernetLarge libraries to 25MHz from 14MHz. Tested OK on W5100 as well as W5500.
  • Loading branch information
khoih-prog authored May 17, 2020
1 parent c0694b5 commit 1ba7fb8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion LibraryPatches/Ethernet/src/Ethernet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress g
void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway, IPAddress subnet)
{
// Initialise the basic info
if (W5100.init() == 0)
if (W5100.init() == 0)
return;

SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
Expand Down
24 changes: 12 additions & 12 deletions LibraryPatches/Ethernet/src/utility/w5100.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@
#include <Arduino.h>
#include <SPI.h>

#ifndef USE_W5500
#define USE_W5500 false
#ifndef USE_W5100
#define USE_W5100 false
#else
#define USE_W5500 true
#define USE_W5100 true
#endif

#if USE_W5500
#if !USE_W5100

// Safe for W5200 and W5500, but too fast for W5100
// Uncomment this if you know you'll never need W5100 support.
// Higher SPI clock only results in faster transfer to hosts on a LAN
// or with very low packet latency. With ordinary internet latency,
// the TCP window size & packet loss determine your overall speed.
#warning Use 30MHz clock for W5200/W5500. Not for W5100
#define SPI_ETHERNET_SETTINGS SPISettings(30000000, MSBFIRST, SPI_MODE0)
// Safe for W5200 and W5500, but also tested OK on W5100
// Use 14MHz if you know your W5100 can't run
// Higher SPI clock results in faster transfer to hosts on a LAN
// or with very low packet latency. With ordinary internet latency,
// the TCP window size & packet loss determine your overall speed.
#warning Use 25MHz clock for W5200/W5500. Not for W5100
#define SPI_ETHERNET_SETTINGS SPISettings(25000000, MSBFIRST, SPI_MODE0)

#else

// Safe for all chips
// Safe for all chips but too slow
#define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
#warning Use 14MHz clock for W5100/W5200/W5500. Slow.

Expand Down
24 changes: 12 additions & 12 deletions LibraryPatches/EthernetLarge/src/utility/w5100.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@
#include <Arduino.h>
#include <SPI.h>

#ifndef USE_W5500
#define USE_W5500 false
#ifndef USE_W5100
#define USE_W5100 false
#else
#define USE_W5500 true
#define USE_W5100 true
#endif

#if USE_W5500
#if !USE_W5100

// Safe for W5200 and W5500, but too fast for W5100
// Uncomment this if you know you'll never need W5100 support.
// Higher SPI clock only results in faster transfer to hosts on a LAN
// or with very low packet latency. With ordinary internet latency,
// the TCP window size & packet loss determine your overall speed.
#warning Use 30MHz clock for W5200/W5500. Not for W5100
#define SPI_ETHERNET_SETTINGS SPISettings(30000000, MSBFIRST, SPI_MODE0)
// Safe for W5200 and W5500, but also tested OK on W5100
// Use 14MHz if you know your W5100 can't run
// Higher SPI clock results in faster transfer to hosts on a LAN
// or with very low packet latency. With ordinary internet latency,
// the TCP window size & packet loss determine your overall speed.
#warning Use 25MHz clock for W5200/W5500. Not for W5100
#define SPI_ETHERNET_SETTINGS SPISettings(25000000, MSBFIRST, SPI_MODE0)

#else

// Safe for all chips
// Safe for all chips but too slow
#define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
#warning Use 14MHz clock for W5100/W5200/W5500. Slow.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

1. Add EthernetWrapper.h for easier W5x00 support as well as more Ethernet libs in the future.
2. Add default SS/CS pin for ESP8266 and ESP32
3. Increase default clock speed for W5x00 in Ethernet and EthernetLarge libraries to 25MHz from 14MHz. Tested OK on W5100 as well as W5500.

#### New in v1.0.8

Expand Down Expand Up @@ -1001,6 +1002,7 @@ BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB

1. Add EthernetWrapper.h for easier W5x00 support as well as more Ethernet libs in the future.
2. Add default SS/CS pin for ESP8266 and ESP32
3. Increase default clock speed for W5x00 in Ethernet and EthernetLarge libraries to 25MHz from 14MHz. Tested OK on W5100 as well as W5500.

#### New in v1.0.8

Expand Down
3 changes: 1 addition & 2 deletions examples/AdvancedWebServer/AdvancedWebServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,7 @@ void setup(void)

#else //defined(ESP8266)
// unknown board, do nothing, use default SS = 10
#ifdef USE_THIS_SS_PIN
#undef USE_THIS_SS_PIN
#ifndef USE_THIS_SS_PIN
#define USE_THIS_SS_PIN 10 // For other boards
#endif

Expand Down
3 changes: 1 addition & 2 deletions src/EthernetWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@

#else //defined(ESP8266)
// unknown board, do nothing, use default SS = 10
#ifdef USE_THIS_SS_PIN
#undef USE_THIS_SS_PIN
#ifndef USE_THIS_SS_PIN
#define USE_THIS_SS_PIN 10 // For other boards
#endif

Expand Down

0 comments on commit 1ba7fb8

Please sign in to comment.