Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Teensy 4.1 SPI1 on W5500 Ethernet module Communication Problem?

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    6

    Teensy 4.1 SPI1 on W5500 Ethernet module Communication Problem?

    Hello Friends,

    I have teensy 4.1 and W5500i Ethernet module. I have installed library for Ethernet2 and sample programme telenetclient running default SPI working properly pin no (10,11,12,13). I have communication with socket server and client using serial port.

    So how to Select SPI1 (0,26,1,27) as a CS1, MOSI1, MISO1, SCK1 work with W5500 Ethernet module?

    Can i change library of Ethernet2 to select SPI1?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,655
    I can't comment on the Ethernet2 library.

    But if you edit Teensy's copy of Ethernet, which is installed at {Arduino}/hardware/teensy/avr/libraries/Ethernet, you will need to replace "SPI" with "SPI1" in 3 files: utility/w5100.cpp, socket.cpp, Ethernet.cpp, and EthernetClient.cpp.

    To help, I ran this command on my Linux machine to make a list of all the places needing edits:

    Code:
    grep -n "SPI\\." src/* src/utility/*
    Here is the full list:

    src/EthernetClient.cpp:185: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/EthernetClient.cpp:187: SPI.endTransaction();
    src/EthernetClient.cpp:197: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/EthernetClient.cpp:199: SPI.endTransaction();
    src/EthernetClient.cpp:209: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/EthernetClient.cpp:211: SPI.endTransaction();
    src/Ethernet.cpp:36: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:39: SPI.endTransaction();
    src/Ethernet.cpp:46: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:50: SPI.endTransaction();
    src/Ethernet.cpp:84: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:95: SPI.endTransaction();
    src/Ethernet.cpp:137: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:141: SPI.endTransaction();
    src/Ethernet.cpp:155: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:157: SPI.endTransaction();
    src/Ethernet.cpp:163: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:165: SPI.endTransaction();
    src/Ethernet.cpp:172: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:174: SPI.endTransaction();
    src/Ethernet.cpp:181: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:183: SPI.endTransaction();
    src/Ethernet.cpp:189: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:191: SPI.endTransaction();
    src/Ethernet.cpp:196: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:199: SPI.endTransaction();
    src/Ethernet.cpp:204: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:207: SPI.endTransaction();
    src/Ethernet.cpp:212: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:215: SPI.endTransaction();
    src/Ethernet.cpp:221: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:223: SPI.endTransaction();
    src/Ethernet.cpp:228: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/Ethernet.cpp:230: SPI.endTransaction();
    src/socket.cpp:74: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:98: SPI.endTransaction();
    src/socket.cpp:122: SPI.endTransaction();
    src/socket.cpp:138: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:162: SPI.endTransaction();
    src/socket.cpp:194: SPI.endTransaction();
    src/socket.cpp:201: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:203: SPI.endTransaction();
    src/socket.cpp:212: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:214: SPI.endTransaction();
    src/socket.cpp:222: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:224: SPI.endTransaction();
    src/socket.cpp:228: SPI.endTransaction();
    src/socket.cpp:238: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:242: SPI.endTransaction();
    src/socket.cpp:251: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:253: SPI.endTransaction();
    src/socket.cpp:308: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:345: SPI.endTransaction();
    src/socket.cpp:354: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:356: SPI.endTransaction();
    src/socket.cpp:369: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:372: SPI.endTransaction();
    src/socket.cpp:436: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:439: SPI.endTransaction();
    src/socket.cpp:448: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:456: SPI.endTransaction();
    src/socket.cpp:459: SPI.endTransaction();
    src/socket.cpp:461: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:465: SPI.endTransaction();
    src/socket.cpp:473: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:476: SPI.endTransaction();
    src/socket.cpp:487: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:495: SPI.endTransaction();
    src/socket.cpp:505: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:508: SPI.endTransaction();
    src/socket.cpp:514: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:522: SPI.endTransaction();
    src/socket.cpp:526: SPI.endTransaction();
    src/socket.cpp:528: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/socket.cpp:533: SPI.endTransaction();
    src/utility/w5100.cpp:107: SPI.begin();
    src/utility/w5100.cpp:110: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/utility/w5100.cpp:195: SPI.endTransaction();
    src/utility/w5100.cpp:198: SPI.endTransaction();
    src/utility/w5100.cpp:282: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/utility/w5100.cpp:284: SPI.endTransaction();
    src/utility/w5100.cpp:288: SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
    src/utility/w5100.cpp:290: SPI.endTransaction();
    src/utility/w5100.cpp:305: SPI.transfer(0xF0);
    src/utility/w5100.cpp:306: SPI.transfer(addr >> 8);
    src/utility/w5100.cpp:307: SPI.transfer(addr & 0xFF);
    src/utility/w5100.cpp:309: SPI.transfer(buf[i]);
    src/utility/w5100.cpp:318: SPI.transfer(cmd, 4);
    src/utility/w5100.cpp:320: SPI.transfer(buf, NULL, len);
    src/utility/w5100.cpp:324: SPI.transfer(buf[i]);
    src/utility/w5100.cpp:372: SPI.transfer(cmd, len + 3);
    src/utility/w5100.cpp:374: SPI.transfer(cmd, 3);
    src/utility/w5100.cpp:376: SPI.transfer(buf, NULL, len);
    src/utility/w5100.cpp:380: SPI.transfer(buf[i]);
    src/utility/w5100.cpp:397: SPI.transfer(0x0F);
    src/utility/w5100.cpp:398: SPI.transfer(addr >> 8);
    src/utility/w5100.cpp:399: SPI.transfer(addr & 0xFF);
    src/utility/w5100.cpp:401: buf[i] = SPI.transfer(0);
    src/utility/w5100.cpp:407: SPI.transfer(cmd, 4); // TODO: why doesn't this work?
    src/utility/w5100.cpp:419: SPI.transfer(cmd, 4);
    src/utility/w5100.cpp:421: SPI.transfer(buf, len);
    src/utility/w5100.cpp:463: SPI.transfer(cmd, 3);
    src/utility/w5100.cpp:465: SPI.transfer(buf, len);
    While this is a long list, the work is simple. Just edit all these lines to change "SPI" to "SPI1". Tedious, but ultimately pretty easy.

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    Thanks For you replay Paul,

    But Is that Library of W5500 work with W5100 ?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,655
    Teensy's Ethernet library works with W5100, W5200 and W5500. Don't let the filename "w5100.cpp" scare you. If you read the source code in that file, you'll see it's filled with code which automatically detects which chip you have connected. The write() and read() functions near the end do indeed adapt automatically, depending on which chip was detected during initialization.

  5. #5
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    ok Thanks Paul i am trying code Ethernet first bu defuault SPI and then SPI1.

  6. #6
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    Ok So Default SPI is working with this w5500 library of ethernet.

    But i have change all SPI to SPI1 for communication of SPI1 as you suggested . Compile But not working?

    is that any other file i have to change?

    I have also change default pin of CS 10 to 0;

  7. #7
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    Hello Paul I have changed All SPI to SPI1
    and also my connection pin is 26,27,38,39 for MOSI1,SCK1,CS1,MISO1 And simple telenet cilent programme.

    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(36): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(39): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(46): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(50): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(84): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(95): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(137): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(141): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(155): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(157): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(163): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(165): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(172): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(174): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(181): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(183): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(189): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(191): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(196): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(199): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(204): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(207): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(212): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(215): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(221): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(223): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(228): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\Ethernet.cpp(230): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\EthernetClient.cpp(185): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\EthernetClient.cpp(187): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\EthernetClient.cpp(197): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\EthernetClient.cpp(199): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\EthernetClient.cpp(209): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\EthernetClient.cpp(211): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(74): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(98): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(122): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(138): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(162): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(194): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(201): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(203): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(212): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(214): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(222): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(224): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(228): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(238): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(242): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(251): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(253): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(308): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(345): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(354): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(356): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(369): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(372): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(436): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(439): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(448): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(456): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(459): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(461): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(465): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(473): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(476): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(487): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(495): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(505): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(508): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(514): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(522): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(526): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(528): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\socket.cpp(533): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(107): SPI1.begin();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(110): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(113): // reset its SPI1 state when CS goes high (inactive). Communication
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(139): // SPI1 well with this chip. It appears to be very resilient,
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(190): // that's heard other SPI1 communication if its chip select
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(191): // pin wasn't high when a SD card or other SPI1 chip was used.
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(195): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(198): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(282): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(284): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(288): SPI1.beginTransaction(SPI_ETHERNET_SETTINGS);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(290): SPI1.endTransaction();
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(305): SPI1.transfer(0xF0);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(306): SPI1.transfer(addr >> 8);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(307): SPI1.transfer(addr & 0xFF);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(309): SPI1.transfer(buf[i]);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(318): SPI1.transfer(cmd, 4);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(320): SPI1.transfer(buf, NULL, len);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(324): SPI1.transfer(buf[i]);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(372): SPI1.transfer(cmd, len + 3);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(374): SPI1.transfer(cmd, 3);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(376): SPI1.transfer(buf, NULL, len);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(380): SPI1.transfer(buf[i]);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(397): SPI1.transfer(0x0F);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(398): SPI1.transfer(addr >> 8);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(399): SPI1.transfer(addr & 0xFF);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(401): buf[i] = SPI1.transfer(0);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(407): SPI1.transfer(cmd, 4); // TODO: why doesn't this work?
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(419): SPI1.transfer(cmd, 4);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(421): SPI1.transfer(buf, len);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(463): SPI1.transfer(cmd, 3);
    C:\Program Files\Arduino\hardware\teensy\avr\libraries\Ethern et\src\utility\w5100.cpp(465): SPI1.transfer(buf, len);
    Matching lines: 107 Matching files: 4 Total files searched: 6

    default SPI is working but not working SPI1.

  8. #8
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    Ok now finally working perfectly i have to change this parameter before Ethernet.begin

    SPI1.setMOSI(26);
    SPI1.setMISO(39);
    SPI1.setSCK(27);

    and also chip select pin in w5100.cpp file line no. 55
    uint8_t W5100Class::ss_pin = SS_PIN_DEFAULT;
    to
    uint8_t W5100Class::ss_pin = 38;

    and working SPI1 of teensy to W5500 module.

    Thanks Paul for your responce.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •