RP2040+EthernetWebserver+E.Philhower Core+SPI1

Hi Im using Earle Philhower pico spi core with EthernetWebServer library on my Raspberry pi pico.

This core uses standard SPI.h i guess, and probably i cant change SPI device with standard spi functions. As fas as i can see there is ony chip sellect option.

Everything works fine with spi0 . But i want to change SPI device from SPI0 to SPI1. Because i want to use both SPIs for different devices.

Other device i want to use is SX1280, it has arduino driver but this driver also has no spi selection only CS pin.

Is there a way to change Ethernet device's spi ?

I tried changing CS pin and wiring every thing to SPI1 connections, as expected it did not worked.

Im bit lost and new with rp2040 and all spi stuff.

what can i do if someone can help i will be gladfull.

Thanks in advance!

not in the WebServer library, but for the underling Ethernet library.
Khoi has new Ethernet library Ethernet_Generic which I think allows to specify the SPI to use.

Thanks @Juraj

I have to modify a very little bit the Ethernet_Generic library to add support to SPI1 for arduino-pico core because every core has different implementation for extra SPI.

For example SPI == SPI0, SPI1 == SPI2, PIN_SPI_MISO, PIN_SPI0_MISO, PIN_SPI1_MISO, SPIClass == SPIClassRP2040, etc.

The new Ethernet_Generic v2.0.1 will be released shortly to support SPI1 for that core.


Terminal

Starting WebClientRepeating on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library with Large Buffer
Ethernet_Generic v2.0.1
[ETG] Default SPI pinout:
[ETG] MOSI: 15
[ETG] MISO: 12
[ETG] SCK: 14
[ETG] SS: 13
[ETG] =========================
[ETG] RPIPICO setCsPin: 13
[ETG] W5100 init, using SS_PIN_DEFAULT = 13 , new ss_pin =  10 , W5100Class::ss_pin =  13
[ETG] Chip is W5500
[ETG] W5100::init: W5500, SSIZE = 8192
[ETG] Default SPI pinout:
[ETG] MOSI: 15
[ETG] MISO: 12
[ETG] SCK: 14
[ETG] SS: 13
[ETG] =========================
Using mac index = 11
Connected! IP address: 192.168.2.89
Speed: 100 MB, Duplex: FULL DUPLEX, Link status: LINK

Connecting...
HTTP/1.1 200 OK
Server: nginx/1.4.2
Date: Fri, 08 Apr 2022 18:21:30 GMT
Content-Type: text/plain
Content-Length: 2318
Last-Modified: Thu, 24 Feb 2022 11:33:35 GMT
Connection: close
Vary: Accept-Encoding
ETag: "62176d0f-90e"
Accept-Ranges: bytes

Please use http://arduino.tips/asciilogo.txt via HTTP

           `:;;;,`                      .:;;:.           
        .;;;;;;;;;;;`                :;;;;;;;;;;:     TM 
      `;;;;;;;;;;;;;;;`            :;;;;;;;;;;;;;;;      
     :;;;;;;;;;;;;;;;;;;         `;;;;;;;;;;;;;;;;;;     
    ;;;;;;;;;;;;;;;;;;;;;       .;;;;;;;;;;;;;;;;;;;;    
   ;;;;;;;;:`   `;;;;;;;;;     ,;;;;;;;;.`   .;;;;;;;;   
  .;;;;;;,         :;;;;;;;   .;;;;;;;          ;;;;;;;  
  ;;;;;;             ;;;;;;;  ;;;;;;,            ;;;;;;. 
 ,;;;;;               ;;;;;;.;;;;;;`              ;;;;;; 
 ;;;;;.                ;;;;;;;;;;;`      ```       ;;;;;`
 ;;;;;                  ;;;;;;;;;,       ;;;       .;;;;;
`;;;;:                  `;;;;;;;;        ;;;        ;;;;;
,;;;;`    `,,,,,,,,      ;;;;;;;      .,,;;;,,,     ;;;;;
:;;;;`    .;;;;;;;;       ;;;;;,      :;;;;;;;;     ;;;;;
:;;;;`    .;;;;;;;;      `;;;;;;      :;;;;;;;;     ;;;;;
.;;;;.                   ;;;;;;;.        ;;;        ;;;;;
 ;;;;;                  ;;;;;;;;;        ;;;        ;;;;;
 ;;;;;                 .;;;;;;;;;;       ;;;       ;;;;;,
 ;;;;;;               `;;;;;;;;;;;;                ;;;;; 
 `;;;;;,             .;;;;;; ;;;;;;;              ;;;;;; 
  ;;;;;;:           :;;;;;;.  ;;;;;;;            ;;;;;;  
   ;;;;;;;`       .;;;;;;;,    ;;;;;;;;        ;;;;;;;:  
    ;;;;;;;;;:,:;;;;;;;;;:      ;;;;;;;;;;:,;;;;;;;;;;   
    `;;;;;;;;;;;;;;;;;;;.        ;;;;;;;;;;;;;;;;;;;;    
      ;;;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;:     
       ,;;;;;;;;;;;;;,              ;;;;;;;;;;;;;;       
         .;;;;;;;;;`                  ,;;;;;;;;:         
                                                         
                                                         
                                                         
                                                         
    ;;;   ;;;;;`  ;;;;:  .;;  ;; ,;;;;;, ;;. `;,  ;;;;   
    ;;;   ;;:;;;  ;;;;;; .;;  ;; ,;;;;;: ;;; `;, ;;;:;;  
   ,;:;   ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;,`;, ;;  ;;  
   ;; ;:  ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;;`;, ;;  ;;. 
   ;: ;;  ;;;;;:  ;;  ;; .;;  ;;   ,;,   ;;`;;;, ;;  ;;` 
  ,;;;;;  ;;`;;   ;;  ;; .;;  ;;   ,;,   ;; ;;;, ;;  ;;  
  ;;  ,;, ;; .;;  ;;;;;:  ;;;;;: ,;;;;;: ;;  ;;, ;;;;;;  
  ;;   ;; ;;  ;;` ;;;;.   `;;;:  ,;;;;;, ;;  ;;,  ;;;;   
1 Like

Check Releases v2.0.1

Releases v2.0.1

  1. Add support to SPI1 for RP2040 using Earle Philhower's arduino-pico core
  2. Add example WebClientRepeating_RP2040_SPI1 to demo the new feature
  3. Update Packages' Patches
1 Like

Check EthernetWebServer now supporting SPI1 for RP2040 using arduino-pico core


Releases v2.1.2

  1. Add support to SPI1 for RP2040 using arduino-pico core
  2. Drop EthernetWrapper
  3. Rewrite all the examples to support new features
  4. Add example multiFileProject to demo how to avoid multiple-definitions linker error for multiple-file project
  5. Update Packages' Patches
1 Like

ahh thank you so much, i will check both of the libraries today !

Works really well with my UDP packed sender program. Thank you again.

One last little question can i use spi1 with EthernetENC library ? İ have spare ENJ28 module and a second pico on spi0 your library works fine, but with spi1 i cant get it work.

again thank you so much!

Good to know you're doing well.

For ENC28J60 using SPI1 with EthernetENC library, you have to wait for @Juraj to modify the library, if possible.

Good Luck,

sorry I don't have time for it now.
Khoi, if you have time and liking. It is pretty standard use of SPI library.

1 Like

@Juraj

Me too, but will have a look if having time, hopefully.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.