I certainly can post a complete program, it's not that I couldn't be bothered I just didn't realise it was the norm to post the entire thing. How much code is too much?
#include <Ethernet2.h>
// Edit the SPI speed in C:\Users\[USERNAME]\Documents\Arduino\libraries\Ethernet2\src\utility\w5500.cpp
// to 28000000, 28MHz, line 25: (copy/paste the following is easiest)
// SPISettings wiznet_SPI_settings(28000000, MSBFIRST, SPI_MODE0);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
const IPAddress MyIP( 192, 168, 0, 10 );
const IPAddress Remote_IP (192, 168, 0, 1);
const unsigned int Remote_Port = 12345;
const unsigned int Local_Port = 12345;
EthernetUDP Udp;
char packetBuffer[UDP_TX_PACKET_MAX_SIZE];
unsigned long current_micros;
const int Testpin = 52;
void setup()
{
Ethernet.begin(mac,MyIP);
Udp.begin(Local_Port);
pinMode(Testpin, OUTPUT);
}
void loop()
{
const unsigned long looptime = 1000;
const int EthTxBuf_Size = 100;
byte EthTxBuf[EthTxBuf_Size];
digitalWrite(Testpin, HIGH);
current_micros = micros();
Udp.beginPacket(Remote_IP, Remote_Port);
Udp.write(EthTxBuf, EthTxBuf_Size);
Udp.endPacket();
digitalWrite(Testpin, LOW);
while ((micros()- current_micros)<looptime)
{
}
}