Changing SCK pin number in Ethernet library

Status
Not open for further replies.

JulesMhz

Member
Hello,

I'm using a teensy 3.1 together with WIZ820io, I use Paul Stoffregen's Ethernet library for W5200. I'm able to send UDP packet from the teensy to my computer without problem, but the SCK pin used is 13, and I would like to use pin 14. I tried to modify w5100.cpp by adding SPI.setSCK(14); like this :

Code:
#ifdef USE_SPIFIFO
 SPI.setSCK(14);
  SPI.begin();
SPIFIFO.setSCK(14);
  SPIFIFO.begin(W5200_SS_PIN, SPI_CLOCK_12MHz);  // W5100 is 14 MHz max
#else
 SPI.setSCK(14);
  SPI.begin();
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  initSS();
#endif

But this does not solves my problem.

Have you got an idea how to use pin 14 for SCK signal ?

Thank you for your help !

Cheers !
Julien.
 
Hello,

It seems that I solve my problem by initializing the SCK pin before Ethernet, not in the Ethernet library like this :

SPI.setSCK(SCKpin);
Ethernet.begin(mac,ip);
Udp.begin(localPort);

Sorry for the disturbance.

Cheers.
Julien.
 
Status
Not open for further replies.
Back
Top