// Safe for all chips
#define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
// 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.
//#define SPI_ETHERNET_SETTINGS SPISettings(30000000, MSBFIRST, SPI_MODE0)
As a first quick and easy thing to try, edit w5100.h inside the Ethernet library. Look for this:
Code:// Safe for all chips #define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0) // 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. //#define SPI_ETHERNET_SETTINGS SPISettings(30000000, MSBFIRST, SPI_MODE0)
Especially if you're receiving fairly large UDP packets, faster SPI clock might help.
I hope you'll let us know how many more LEDs using faster SPI clock lets you receive. I'm pretty sure double the clock speed will give less than 2X because the W5500 chip has overhead for each transfer.
// Safe for all chips
//define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
// 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.
#define SPI_ETHERNET_SETTINGS SPISettings(60000000, MSBFIRST, SPI_MODE0)
Have you considered using the Ethernet Kit to use Teensy 4.1’s built-in Ethernet PHY? The QNEthernet library, for example, lets you change a number of settings and sizes. I’ve personally successfully used dozens of universes on a Teensy 4.1.
As a first quick and easy thing to try, edit w5100.h inside the Ethernet library. Look for this:
Code:// Safe for all chips #define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0) // 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. //#define SPI_ETHERNET_SETTINGS SPISettings(30000000, MSBFIRST, SPI_MODE0)
Especially if you're receiving fairly large UDP packets, faster SPI clock might help.
I hope you'll let us know how many more LEDs using faster SPI clock lets you receive. I'm pretty sure double the clock speed will give less than 2X because the W5500 chip has overhead for each transfer.
// Safe for all chips
//#define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
// 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.
#define SPI_ETHERNET_SETTINGS SPISettings(30000000, MSBFIRST, SPI_MODE0)
// Configure the maximum number of sockets to support. W5100 chips can have
// up to 4 sockets. W5200 & W5500 can have up to 8 sockets. Several bytes
// of RAM are used for each socket. Reducing the maximum can save RAM, but
// you are limited to fewer simultaneous connections.
#if defined(RAMEND) && defined(RAMSTART) && ((RAMEND - RAMSTART) <= 2048)
#define MAX_SOCK_NUM 1
#else
#define MAX_SOCK_NUM 1
#endif
but I found that my Artnet reception will start to freeze after the 8th universe.
....
I am now using w5500 module and Artnet library and modified the parameters in w5100.h.
so I changed the SPI clock to 40-45Mhz.