Report
6 years, 5 months ago.

[SOLVED] Porting Maniacbug nRF24L01+ arduino library

Hi guys,

I need communication between an mbed with nrf24l01+ and arduino nano with nrf24l01+. Since the libraries are all community driven, I figured I would try to port the Maniacbug arduino lib since it's the most complete library for the nrf24l01+. I'm running into some issues though, probably to do with the difference in SPI communication.

There is no communication between the devices right now and printing the configuration of the mbed nrf24l01+ gives me different results than what I set at startup.

Perhaps anyone can figure this out or can run the code on their own hardware and help out?

What I have so far is the arduino library adjusted to work with the mbed SPI and the incompatible avr-libc functions removed. The original library can be found here: https://github.com/maniacbug/RF24

This is the ported code: http://mbed.org/users/Christilut/code/nRF24L01P_Maniacbug/

Ask away if there is any confusion, thanks!

Comment on this question

3 Answers

6 years, 5 months ago.

Hi!

I've ported an arduino library for RFM22-Modules from arduino to mbed. See here http://mbed.org/users/charly/notebook/rfm22/

This uses SPI and interrupts. Works without problem.

You can see the relevant code in RF22.cpp in RF22::init() The old arduino-code is still there.

Hope this helps.

Charly

6 years, 5 months ago.

Thanks, I looked through it and it confirms part of my code. They seem to be using SPI the same way.

I guess I can assume the SPI works properly, there must be a bug (or multiple) elsewhere then... Can't quite figure this one out though =/

Got it working, turns out if was an auto-ack issue.

Some minor issues are still there but it should work fine.

For those interested: https://mbed.org/users/Christilut/code/nRF24L01P_Maniacbug/

posted by Christiaan M 05 Apr 2013
6 years, 5 months ago.

Hi,

I had a similar issue. If you want Arduino - mbed communication, this class could be the best choice to start:

http://www.airspayce.com/mikem/arduino/NRF24/

The ping examples explain the usage. I tried two mbed implementations: 1st: simple SPI wrapper, since this is the most important aspect - didn't work (don't know why). Second, I used the NRF24 example: http://mbed.org/users/Owen/code/nRF24L01P_Hello_World/

Than I imported all routines from the arduino library, be carefull to change SPI, CE and CS pin configurations! The constructor tries to set everything to default.

Finally, the ping exmple works, but few delays are necessary in the mbed main program, since the arduino seems to be too slow...

Regards

Tobias


You need to log in to post a question