The code is just the DHCPAddressPrinter example. I did try and breakdown some of the .begin function using this
#include <SPI.h>
#include <IPAddress.h>
#include <Dhcp.h>
#include "C:/Program Files (x86)/Arduino/libraries/Ethernet/src/utility/w5100.h"
/*
* Copyright (c) 2010 by Arduino LLC. All rights reserved.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of either the GNU General Public License version 2
* or the GNU Lesser General Public License version 2.1, both as
* published by the Free Software Foundation.
*/
#include <stdio.h>
#include <string.h>
// W5100 controller instance
//W5100Class W5100;
#define TX_RX_MAX_BUF_SIZE 2048
#define TX_BUF 0x1100
#define RX_BUF (TX_BUF + TX_RX_MAX_BUF_SIZE)
#define TXBUF_BASE 0x4000
#define RXBUF_BASE 0x6000
byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02
};
byte ip[] = {
0, 0, 0, 0, 0, 0
};
DhcpClass *_dhcp;
void setup() {
static DhcpClass s_dhcp;
_dhcp = &s_dhcp;
Serial.begin(9600);
while (!Serial) {
}
// start the Ethernet connection:
Serial.println("1");
W5100.init();
Serial.println("2");
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
Serial.println("3");
W5100.setMACAddress(mac);
Serial.println("4");
W5100.setIPAddress(ip);
SPI.endTransaction();
Serial.println("5");
int ret = _dhcp->beginWithDHCP(mac, 10, 40);
Serial.println("6");
}
void loop() {
}
That hangs on int ret = _dhcp->beginWithDHCP(mac, 10, 40); after printing "5"
No additional hardware on the SPI port
Robert