lmaw
lmaw

Reputation: 23

Arduino Due RF24 SPI not working

I want to connect RF24 to the Arduino Due, but it's not working correctly. Arduino Due board runs at 3.3, so I need to use a logic level converter because the RF24 pins are using 5v except for Vcc(3.3v). I connect the MISO/MOSI/SCK to the ICSP headers on the board and connect CSN to pin 10, and CE to pin 9.

Code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL; 
int LED1 = 13;

void setup() {
  Serial.begin(115200);
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  delay(20);
  pinMode(10, OUTPUT);
  radio.begin();
  radio.setRetries(15,15);
  radio.openReadingPipe(1,pipe);            
  radio.setPALevel(RF24_PA_LOW);
  radio.printDetails();
  radio.startListening();
}

void loop() {
  byte gotByte;  
  while( radio.available()){  
    radio.read( &gotByte, 1 );                                                              
    Serial.println(gotByte);  
  }
}

Output (printDetails):

STATUS       = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0

RX_ADDR_P0-1     = 0x0000000000 0x0000000000

RX_ADDR_P2-5     = 0x00 0x00 0x00 0x00

TX_ADDR      = 0x0000000000

RX_PW_P0-6   = 0x00 0x00 0x00 0x00 0x00 0x00

EN_AA        = 0x00

EN_RXADDR    = 0x00

RF_CH        = 0x00

RF_SETUP     = 0x00

CONFIG       = 0x00

DYNPD/FEATURE    = 0xff 0xff

Data Rate    = 1MBPS

Model        = nRF24L01

CRC Length   = 16 bits

PA Power     = PA_MAX

Output doesn't make sense, what am I doing wrong?

Library: https://github.com/nRF24/RF24

Upvotes: 1

Views: 769

Answers (0)

Related Questions