W5200 UDP not working??? Teensy 3.2

Status
Not open for further replies.

olivierdemoustier

Active member
I'm used to work with W5100 ethernet shields. Never had problems. But need to go faster now. So I bought wiz820io. based on W5200 chipset. Whatever I do I cannot receive UDP packets. I have tried multiple Ethernet Libraries. including https://github.com/PaulStoffregen/Ethernet.
I Have communication with the shield because it pings me the Ip adress and tels me it is a W5200. (see code). But no packets are received. If I use the same code on a W5100. It works perfectly. What am I doing wrong? Please advice.

//PINOUT: WIZ820io :SCK=13 MISO=12 MOSI=11 CS=10 RST=9 PWDN=gnd

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>


byte Mac[] = {0x74,0x69,0x69,0x2D,0x30,0x15};
IPAddress ip(192, 168, 1, 179);

EthernetUDP Udp;


void setup() {
//reset the WIZ820io
pinMode(9, OUTPUT);
digitalWrite(9, LOW); // begin reset the WIZ820io
delay(50);
digitalWrite(9, HIGH); // end reset pulse
delay(5000);

Serial.begin(19200);
delay(10); // let UART settle

Ethernet.begin(Mac, ip );

// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.hardwareStatus() == EthernetW5200) {
Serial.println("W5200");
}
if (Ethernet.hardwareStatus() == EthernetW5100) {
Serial.println("W5100");
}
if (Ethernet.hardwareStatus() == EthernetW5500) {
Serial.println("W5500");
}
// Check for Ethernet cable connected
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}

Udp.begin(5568);

delay(10);
// Check if IP adress is set to WIZ820io
Serial.print("ip adress : ");
Serial.println(Ethernet.localIP());
delay(1000);
}



void loop() {

//Process packets
int packetSize = Udp.parsePacket(); //Read UDP packet count

if (packetSize) {
Serial.print("Packet received with size = ");
Serial.println(packetSize);
// Udp.read(gPacketBuffer, ETHERNET_BUFFER); //read UDP packet
}
}
 
Status
Not open for further replies.
Back
Top