NRF24L01

Tiago
Fri Jun 05, 2015 10:42 pm
I’m using is library: https://github.com/TMRh20/RF24

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

#define PINCSN 7
#define PINCE 18

[b][u]byte data[2];[/u][/b] RF24 radio(PINCE,PINCSN);
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(){
Serial.begin(115200);
radio.begin();
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_1MBPS);
radio.openReadingPipe(1,pipe);
radio.startListening();
}

void loop(){
if(radio.available()){
radio.read(&data, sizeof(data));
}
Serial.println(data);
}


mrburnette
Fri Jun 05, 2015 10:49 pm
Welcome Tiago:

You must use the ported library here:

viewtopic.php?f=13&t=138

The STM32 is a 32-bit device, so libraries must be reworked a bit to be compatible.

Ray

Edit: I made a funny “reworked a bit” :shock:


Tiago
Fri Jun 05, 2015 10:53 pm
ok, I’ll take a look. thank you

jarno83
Tue Jun 30, 2015 6:29 pm
Hi, has anybody got nrf24 library – https://github.com/maniacbug/RF24
working with maple mini, where do I connect it to? Thanks

RogerClark
Wed Jul 01, 2015 12:41 am
Any reason you cant use this one

viewtopic.php?f=13&t=138


jarno83
Wed Jul 01, 2015 4:17 am
RogerClark wrote:Any reason you cant use this one

viewtopic.php?f=13&t=138


victor_pv
Thu Jul 02, 2015 5:07 am
jarno83 wrote:RogerClark wrote:Any reason you cant use this one

viewtopic.php?f=13&t=138


RogerClark
Thu Jul 02, 2015 6:26 am
SPI is on pins 4,5,6, and 7 on the Maple mini (well thats on the silkscreen)

(LOL) I just checked and 7 is NSS which is PA4, so this will only work if you use a fairly recent version of the repo which has the fix for STM’s NSS feature / bug ;-)


jarno83
Thu Jul 02, 2015 6:44 pm
Thanks, but I’m still struggling :)

Setup:
NRF24 – MAPLE MINI

GND – GND
VCC – VCC
CE – 3 (PB0)
CSN – 7 (PA4)
SCK – 6 (PA5)
MOSI – 4 (PA7)
MISO – 5 (PA6)
IRQ – 1 (PB10)

Some info is from here – http://www.stm32duino.com/viewtopic.php?t=138

EDITED


martinayotte
Thu Jul 02, 2015 7:05 pm
I think you mismatch the SPI pins. Take a look about the following pinout :

Maple Mini.png
Maple Mini.png (232.4 KiB) Viewed 8346 times

jarno83
Thu Jul 02, 2015 8:01 pm
martinayotte wrote:I think you mismatch the SPI pins. Take a look about the following pinout :

Maple Mini.png


martinayotte
Thu Jul 02, 2015 9:01 pm
But still nowhere to connect CSN..

jarno83
Fri Jul 03, 2015 4:18 am
martinayotte wrote:But still nowhere to connect CSN..

Leave a Reply

Your email address will not be published. Required fields are marked *