WIZ550io Arduino Teensy 3.1 호환 문제입니다

WIZ550io Arduino Teensy 3.1 호환 문제입니다.
WebServer demo 프로그램을 컴파일해서 실행하면.
Arduino UNO에선 이상 없이 동작하는데 Teensy 3.1과 연결하면 ip address를 192.168.1.177로 하면
시리얼 모니터에서 168.1.0 이라는 엉뚱한 값을 출력하면서 동작하지 않습니다.

pin map은

Arduino ? WIZ550io

(5 M-M jumper wires)

3v3 ? J1.8

GND ? J1.1

D2 ? J2.5 (INT)

D7 ? J2.2 (RDY)

D10 ? J1.6 (SCS)

(SPI needs 4 F-M jumper wires)

D.12 ? J1.4 (MISO)

D.13 ? J1.5 (SCK aka SCLK)

D.9 ? J2.3 (RST)

D.11 ? J1.3 (MOSI)

입니다.

안녕하세요.

시리얼 모니터에서 IP를 제대로 못받아오는 경우가 있는데요.

Teensy 3.1은 Cortex-M4 네요.

예상 문제점은 SPI 신호가 정상적으로 동작안하는 것 같습니다.

현재 WIZ550io에는 전압 신호 나누기위한 용도로 buffer를 사용하고 있습니다.
하지만 SPI신호가 buffer를 거치게 되면 신호에 Delay가 발생하게 됩니다.
그래서 신호가 밀리는 현상이 발생하는 것 같습니다.
혹시 W5500 Library의 SPI속도를 낮추고 다시 한 번 시도해보시겠습니까?
Tool 환경은 어떤것으로 하시는 건가요??

감사합니다.

tool 환경은 Arduino 1.6.7
teensy 에디션입니다.

teensy platform.txt에 버전정보가 다음과 같습니다.

pjrc.com/teensy/teensyduino.html

name=Teensy Boards
version=1.6.6

최신버전 다운 받았으니 Teensyduino, Version 1.27 이네요.

// 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 하면 리플라이 날라 옵니다.

안녕하세요.

일단 올리신 코드를 제가 Arduino Mega로 돌려본 결과, 정상 동작하는 것 확인하였습니다.

시리얼 모니터에서 192.168.1.177라고 나오네요.

코드는 아래와 같습니다.


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

#if defined(WIZ550io_WITH_MACADDRESS)
;
#else
byte mac = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
#endif
IPAddress ip(192, 168, 1, 177);

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());
}

void loop() {
}


몇가지 테스트를 진행해보아야 할 것 같습니다.

  1. DHCP로 IP값을 받아서 그대로 출력해서 확인해보시겠어요??
    → IP값 받는 것도 밀리는지 테스트 필요합니다.

  2. W5500 Ethernet shield를 보유하고 계신다면 테스트해보시겠어요??
    → 위에서 말씀드린바와 같이 WIZ550io에는 버퍼가 있기 때문에 최고 속도가 어렵습니다.

Teeny(MK20DX256VLH7) cortex-M4의 데이터시트의 SPI를 보면,
cache.freescale.com/files/32bit/ … M72SF1.pdf

52페이지에 보시면 Frequency of operation 가 25Mhz로 동작합니다.
하지만 현재 W5500의 Spec에 72Mhz 중 실제 사용가능한 스피드는 36Mhz입니다.
여기서 25Mhz를 동작시키려면 W5500이 36Mhz로 동작해야합니다.
하지만 WIZ550io에 부착되어 있는 버퍼가 있음으로 인해 Delay가 생기게 됩니다.
이 Delay로 인해서 25Mhz SPI가 제대로 동작이 안될 경우가 있기 때문에,
W5500 Ethernet shield (버퍼가 부착되지 않은)를 사용하여 테스트를 한번 해보시는 것을 추천드립니다.
우선 저희 W5500 Ethernet shield가 버퍼가 부착되지 않은 제품이 있습니다.

감사합니다.