Jump to content
43oh

[Energia Library] Nordic nRF24L01+ library


Recommended Posts

Awesome, thanks for the reply and the example code.  My only thought on this would be in any type of ISR handler you should only be doing the bare minimum.  I would hope no libraries would do a SPI transaction from inside an interrupt routine.  

I believe the CC3100 (WiFi) library does this unfortunately.... something I caught and was like "uh WTF" but knock on wood it's worked well enough.  I could see an argument for doing this with something that's fairly timing sensitive.  Absolutely *have* to have something like that SPI Transaction support though.

Link to post
Share on other sites
  • 4 weeks later...
  • Replies 352
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi folks... So I'm a little new to Energia, but since I wrote a library for the nRF24L01+ digital transceivers for native C-based apps I figured it'd be a great idea to port this to Energia.   I'm r

Ok, so I ported the Enrf library over so that it works with both MSP430 and Stellaris.  Seems to work great.  I am watching the tx rx demo between msp430g2553 (on the RX side), and the StellarPad doin

Okie doke - https://github.com/spirilis/Enrf24   The examples are the same as the ones I posted... I'll write up the API in a wiki page soon.  Alternately, I put documentation in the Enrf24.h file f

Posted Images

Hi,

 

I'm having a problem getting the MSP-EXP430F5529LP to work with this library.  Has anyone been successful using the nRF24 with the 430F5529?

 

My hardware is:

MSP-EXP430F5529LP

cheap nRF24L01 transceivers

 

I am using the library examples and the following pins:

/*
nrf24l01          MSP430F5529
Signal            LaunchPad
-----------       -----------
  VCC               3V3
  GND               GND
  SCK               P3.2
  CE                P2.7
  CSN               P1.2
  IRQ               P1.3
  MISO              P3.1
  MOSI              P3.0
*/
Enrf24 radio(P2_7, P1_2, P1_3);    // CE, CSN, IRQ pins     MSP430F5529

 

The serial monitor makes it appear that things are working.  For example, with the transmit example I get the following serial output repeatedly:

 

Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption
Sending packet: ON
Enrf24 radio transceiver status: IDLE module powered up w/ oscillators running
Sending packet: OFF
Enrf24 radio transceiver status: IDLE module powered up w/ oscillators running
Sending packet: ON
 

For the receiver I get:

 

Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption
Enrf24 radio transceiver status: Receive Mode
 

The problem is that the LED does not blink correctly and I don't get regularly serial messages about receiving a packet.  Rarely, it will recieve one packet, normally right after initializing.  The receiver and transmitter are located a few feet apart.  The channel scanning sketch shows some activity.

 

I've tried the following without success:

* set clock divider at 6 and 8, e.g. SPI.setClockDivider(6);

* set radio.begin(250000);

* checked wiring

 

Am I doing something wrong or would the library need modification to work with the 430F5529?

Link to post
Share on other sites

Thanks for the quick response...

 

Channels and bitrate/datarate are the same.  I tried moving one radio into the next room and the rate of capturing the first packet quickly is higher now. 

 

I've been working on it and here are a couple of new observations...

 

* it sometimes will receive one or even two "on" transmissions and then the "off".  Of course at times it receives the "off" first.  Regardless, it doesn't seem to receive any more packets after the first "off"

* If I reset the receiver, it will work again until it gets an "off"

* I tried putting one in transmit mode on a quiet channel with only a 10 millis delay and then using the channel scanning on the other to see how strong it was and it barely registered. 

* I tried swapping the transceivers in transmission and reception, sitll no luck

* I went back and did a new install of the library - it got worse.  I made SPI.setClockDivider(8) and it seemed to get better again but kept stopping after receipt of the first "off" packet

* Changed bit rate to 250000.  It still stops after the first "off" packet.

* Changed bit rate back to 1000000 and changed to different channel that seemed quieter.  It still stops after the first "off" packet received.

 

I'm out of ideas, only changing SPI clock divider and moving the radio away seemed to help.  I don't understand why it would successfully receive one or two transmissions and then stop.  Maybe one of the nRFs is bad, but I only have the two so can't swap one out right now.  Unfortunately I will be away for a few days and unable to work on my project but appreciate any other thoughts, especially if there is anything different you do for the F5529LP - i.e. change the SPI.setClockDivider since the MCU is running at 25MHz.

Link to post
Share on other sites
  • 2 weeks later...
  • 3 weeks later...

I am trying without luck to understand the flow of the Enrf demo programs and  libraries. I have set up a pair of Transceivers and

they work okay with the demo programs.

The libraries and demo programs are an excellent tool for Further development.

 

I am an amateur at

Link to post
Share on other sites

Hello Larry,

 

I find C a bit cryptic myself.

 

"Enrf24 radio(P2_0, P2_1, P2_2);" passes the LaunchPad pins that are connected to CE, CSN, and IRQ on your transceiver.  You could change these pins if needed.

 

The second question regards a statement in the TX example that is checking to see if anything has been received.  The contents, if any, are in the array inbuf defined by the statement "char inbuf[33];" which is higher up in the program.

 

Hope this helps.

Link to post
Share on other sites
  • 2 weeks later...

Greetings..

 

I was intending to use this library for a project involving sending of data between 2 systems.. but unfortunately i can't even seem to be able to open energia after copying all the contents to the libraries folder in my sketchbook..

 

I am using Ubuntu 14.04 and energia 15

 

Any ideas why??

 

Thanks

Link to post
Share on other sites

Greetings..

 

I was intending to use this library for a project involving sending of data between 2 systems.. but unfortunately i can't even seem to be able to open energia after copying all the contents to the libraries folder in my sketchbook..

 

I am using Ubuntu 14.04 and energia 15

 

Any ideas why??

 

Thanks

I encountered that.  Weird glitch with Arduino and Energia.  Using a larger screen will help, alternately, find your Energia preferences file (~/.energia/preferences.txt I think) and switch the default to a different architecture, e.g.-

 

target=lm4f

board=lptm4c1230c3pm

(remove the existing target= and board= lines from that file)

 

Energia should start up OK, then you can switch back over to MSP430 or whatever.  I've only see this issue when choosing an MSP430-based board, closing Energia and then re-opening it.  It's a weird visual/GUI glitch in the Java code from what I gathered but it's based on the total # of libraries available for the arch (which determines the GUI size of the Examples menu where I think the glitch lives), which is why switching arch's before startup seems to work.

Link to post
Share on other sites
  • 2 months later...

Hi @@spirilis, I am considering using a NRF24 with the new educational boosterpack,the problem is, it uses to many pins! (the boosterpack).

I wanted to use a TM4C123 but it simply has not enough pins. The TM4C1294 would do but I only have one and I need it for something else (if possible), so I was considering the MSP432 since it has those bottom pins. Problem is it would require bit-banged SPI for that. Did you ever implement that?
If not, any advises in how to do that easily? (like is there a functions always used to push the SPI data on your library that I can simply change and just use the shiftIn and shiftOut functions)

Also considering using different CS pins though I have never done that, not quite sure how that works if data is received from the nordic

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...