// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
#if defined(WIZ550io_WITH_MACADDRESS)
;
#else
byte mac = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
#endif
IPAddress ip(192, 168, 1, 177);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// start the Ethernet connection and the server:
#if defined(WIZ550io_WITH_MACADDRESS)
Ethernet.begin( ip);
#else
Ethernet.begin(mac, ip);
#endif
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}
///////////////////////////////////////////////
spi 속도 조절
//////////////////////////////////////
void W5500Class::init(void)
{
delay(1000);
#if defined(ARDUINO_ARCH_AVR)
initSS();
SPI.begin();
#else
SPI.begin(SPI_CS);
// Set clock to 4Mhz (W5100 should support up to about 14Mhz)
SPI.setClockDivider( SPI_CLOCK_DIV128);
// SPI.setClockDivider(SPI_CS, 6); // 14 Mhz, ok
// SPI.setClockDivider(SPI_CS, 3); // 28 Mhz, ok
//SPI.setClockDivider(SPI_CS, 2); // 42 Mhz, ok
// SPI_CLOCK_DIV2 gives me a 4.0 MHz SPI clock
//SPI_CLOCK_DIV4 gives me a 4.0 MHz SPI clock
//SPI_CLOCK_DIV8 gives me a 2.0 MHz SPI clock
//SPI_CLOCK_DIV16 gives me a 2.0 MHz SPI clock
//SPI_CLOCK_DIV32 gives me a 250 kHz SPI clock
//SPI_CLOCK_DIV64 gives me a 250 kHz SPI clock
//SPI_CLOCK_DIV128 gives me a 250 kHz SPI clock
SPI.setDataMode(SPI_CS, SPI_MODE0);
#endif
for (int i=0; i<MAX_SOCK_NUM; i++) {
uint8_t cntl_byte = (0x0C + (i<<5));
write( 0x1E, cntl_byte, 2); //0x1E - Sn_RXBUF_SIZE
write( 0x1F, cntl_byte, 2); //0x1F - Sn_TXBUF_SIZE
}
}
이렇게 해도 안되구요.
///////////////////////////////////////
시리얼 모니터에 처음 시작시 이렇게만 뚜구요.
server is at 168.1.2.0
/////////////////////
pc 도스 창에서 PING 192.168.1.2 하면 리플라이 날라 옵니다.