I am unable to get a Boron to connect to a NRF24L01+ via SPI. After reading the Boron documentation and Community articles and examples regarding SPI and the Boron I have not been able to identify the issue.
Using an adapter to ease connections between the Boron and the NRF24L01+. I tried multiple new Boron BRN404X, various NRF24L01+ board and the adapters.
Various combinations of the adapters and NRRF24L01+. which are all able to communicate when connected an Arduino (Lolin D1 Mini Pro). But, always hang at the radio.begin() with any Boron.
What am I missing? Any suggestions? Thanks!
- Boron BRN404X w/OS 6.1.1
- Connected as described in the code and shown in the photos (SPI0)
- Using particle-rf24 (0.0.2) library
- Connected the NRF24L01+ to Boron via using an adapter board
- Debug attempts: Added delay(100) with and without Serial.print statements within the while radio.begin() loop to be sure I knew where it hung.
- Tried both with and without a battery attached
- Tried tweaking the Spark_GettingStartedRF24.cpp with both the SparkCore-RF24 (it does not wait for radio.begin()) and particle-rf24 libraries.
Simple SPI/radio connection test code
// Include Particle Device OS APIs
#include "Particle.h"
#include <particle-rf24.h>
SYSTEM_MODE(AUTOMATIC);
SerialLogHandler logHandler(LOG_LEVEL_INFO);
/*
Boron 404X
Signals | Pin | Wire Color | Adapter Pin | NRF24L01+
--------------------------------------------------------------------------------------------
GND GND Black GND 1 GND
3V3 (3.3V) 3.3v Red Vcc 2 VCC
A4/D15 15 Grey CE 3 CE
A5/D14 (SPI_SS) 14 White CSN 4 CSN
SCK/D13 (SPI_SCK) 13 Dk Blue SCK 5 SCK
MO/D12 (SPI_MOSI) 12 Red MO 6 MO
MI/D11 (SPI_MISO) 11 Yellow/Blue MI 7 MI
*/
#include <SPI.h>
#include <nRF24L01.h>
RF24 radio(A4, A5); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(115200);
while (!Serial) { }
Serial.println("Version 0.01d");
while (!radio.begin()){}
Serial.println("Connected SPI");
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
Serial.println("Sent");
delay(1000);
}