user37987: I am programming a RaspberryPi Pico with the Arduino IDE. Works pretty well, but now I try to control an nrf24l01 module.
My code compiles but I do not know on which pins the SPI bus has to be hocked up. I tried to connect to different pins according the pinout
https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf
(for example 2 sck, 3 miso, 4 mosi), but nothing worked so far.
Does anybody know what the default pins are or how to control them? I also would like to control other SPI hardware, for example a display.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

const uint64_t address = 0x1;
byte sendData[1];


#define CSN_PIN  5
#define CE_PIN   6
RF24 radio(CE_PIN, CSN_PIN); 

byte counter = 0;
 
void setup()   
{
  Serial.begin(115200);
  Serial.println(“radio starting");

  if (!radio.begin()) 
  {
    Serial.println("radio hardware is not responding!!");
    while (1) {} 
  }  
  radio.openWritingPipe(address);
}

void loop()   
{
  Serial.print("Counter: ");
  Serial.println(counter);
  
  sendData[0] = counter;
  
  radio.write( sendData, sizeof(sendData));
  
  counter++;
}


user70436: 
For Arduino-pico core
** MISO - pin GP16
** MOSI - pin GP19
** CS   - pin GP17
** SCK  - pin GP18

Arduino-mbed core
** MISO - pin GP4
** MOSI - pin GP3
** CS   - pin GP5
** SCK  - pin GP2



37987: <p>I am programming a RaspberryPi Pico with the Arduino IDE. Works pretty well, but now I try to control an nrf24l01 module.</p>
<p>My code compiles but I do not know on which pins the SPI bus has to be hocked up. I tried to connect to different pins according the pinout
<a href="https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf" rel="nofollow noreferrer">https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf</a>
(for example 2 sck, 3 miso, 4 mosi), but nothing worked so far.</p>
<p>Does anybody know what the default pins are or how to control them? I also would like to control other SPI hardware, for example a display.</p>
<pre><code>#include &lt;SPI.h&gt;
#include &lt;nRF24L01.h&gt;
#include &lt;RF24.h&gt;

const uint64_t address = 0x1;
byte sendData[1];


#define CSN_PIN  5
#define CE_PIN   6
RF24 radio(CE_PIN, CSN_PIN); 

byte counter = 0;
 
void setup()   
{
  Serial.begin(115200);
  Serial.println(“radio starting&quot;);

  if (!radio.begin()) 
  {
    Serial.println(&quot;radio hardware is not responding!!&quot;);
    while (1) {} 
  }  
  radio.openWritingPipe(address);
}

void loop()   
{
  Serial.print(&quot;Counter: &quot;);
  Serial.println(counter);
  
  sendData[0] = counter;
  
  radio.write( sendData, sizeof(sendData));
  
  counter++;
}
</code></pre>
 70436: <ol>
<li><p>For Arduino-pico core</p>
<p>** MISO - pin GP16</p>
<p>** MOSI - pin GP19</p>
<p>** CS   - pin GP17</p>
<p>** SCK  - pin GP18</p>
</li>
<li><p>Arduino-mbed core</p>
<p>** MISO - pin GP4</p>
<p>** MOSI - pin GP3</p>
<p>** CS   - pin GP5</p>
<p>** SCK  - pin GP2</p>
</li>
</ol>
