Using an nRF24L01 with an Adafruit Wav Shield

Hello all,

I'm trying to make my project wireless, I'm using and I have some questions about the SPI interfaces. The nRF24L01 has the following pinout:

with
1 - GND
2 - VCC 3.3V
3 - CE to Arduino pin 8
4 - CSN to Arduino pin 53 (using a mega)
5 - SCK to Arduino pin 52
6 - MOSI to Arduino pin 51
7 - MISO to Arduino pin 50
8 - UNUSED

The problem is that the adafruit shield uses the same 50-53 pins for its SPI interface, I don't think it uses pin 8 though.

I've read that you can just share the SCK, MOSI and MISO lines across 2 SPI devices, but what about CSN or CE, what are CSN and CE and can I connect them to these Pins? One of the libraries for the reciever says CSN and CE are configurable, but I'm not sure how to do this, I'm using the RF24 library from GitHub - maniacbug/RF24: Arduino driver for nRF24L01

Thanks

(deleted)

(deleted)

this really doesn't answer my question, can you connect these MOSI, MISO, SCK, and CSN pins to both the wav shield and the nRF receiver. I have the datasheet but it doesn't help me figure out how to make the arduino interface with these things separately.

the csn and ce pins are not tied to any hardware pins, so you can connect them to anything as long as you can change the library accordingly. Note ce is related to spi ( SS pin) and there is a hardware ss pin ( pin 10) but I do not think it is a problem.

the pins are declared in the constructor, RF24 ( uint8_t _cepin, uint8_t _cspin );

Silverxxx:

how do you change the library? I’ve found some instances of the declaration but nowhere that it says which pin to use. Here is what the libraries look like, the whole thing is here: GitHub - maniacbug/RF24: Arduino driver for nRF24L01

in RF24.h:

/**
 * Driver for nRF24L01(+) 2.4GHz Wireless Transceiver
 */

class RF24
{
private:
  uint8_t ce_pin; /**< "Chip Enable" pin, activates the RX or TX role */
  uint8_t csn_pin; /**< SPI Chip select */
  bool wide_band; /* 2Mbs data rate in use? */
  bool p_variant; /* False for RF24L01 and true for RF24L01P */
  uint8_t payload_size; /**< Fixed size of payloads */
  bool ack_payload_available; /**< Whether there is an ack payload waiting */
  bool dynamic_payloads_enabled; /**< Whether dynamic payloads are enabled. */ 
  uint8_t ack_payload_length; /**< Dynamic size of pending ack payload. */
  uint64_t pipe0_reading_address; /**< Last address set on pipe 0 for reading. */

in RF24.cpp:

void RF24::csn(int mode)
{
  // Minimum ideal SPI bus speed is 2x data rate
  // If we assume 2Mbs data rate and 16Mhz clock, a
  // divider of 4 is the minimum we want.
  // CLK:BUS 8Mhz:2Mhz, 16Mhz:4Mhz, or 20Mhz:5Mhz
#ifdef ARDUINO
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE0);
  SPI.setClockDivider(SPI_CLOCK_DIV4);
#endif
  digitalWrite(csn_pin,mode);
}

where can I tell it to use, for example, pin 18 and 19 on the mega