NRF24L01

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone,
My name is Aneesh and I am new to this forum. I am just starting with my AVR Adventures. My first interest is to develop wireless communication between two AVRs using NRF24L01. After a good 4 hours of browsing, I can't seem to find a decent post that goes with the basics of NRF-AVR SPI communication. So far I have found this:

" http://gizmosnack.blogspot.com/2013/04/tutorial-nrf24l01-and-avr.html " Can you please suggest me a library that I can start off with and learn by myself.

 

Thanks  

Aneesh Kola

Last Edited: Tue. Jan 14, 2020 - 01:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You have now posted effectively the same thing in two places - please don't do that - it splits the discussion.

 

Before going further I notice you chose to put this second post in the Xmega forum - does that imply that the AVR you are using is Xmega rather than Tiny/Mega? 

 

If the radio chip interfaces via SPI then it's important to know which AVR it is as the SPI operation is quite different in Xmega compared to tiny/mega (but rather more confusing is that the latest tiny/mega released are actually more like Xmega)

 

Note a further complication (as shown by the article you linked to) is that if the AVR you use is old style tiny/mega then there's a further difference between those two - most mega have real SPI but most tiny have a half-implemented form of SPI called USI). So it really matters which AVR you are trying to do this with.

 

Oh and in this day and age "Arduino" may well be the best way to do thins kind of thing anyway.

Last Edited: Tue. Jan 14, 2020 - 12:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My apologies for posting it twice. I was unsure about the visibility of the other post.

Thanks for the quick response.

I am trying not to go down the arduino path. I am not using the TINYs. I have ATmega2560 and 328P that want to communicate. 

Aneesh Kola

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In which case I'll move this thread to Tiny/Mega forum as your are using traditional SPCR/SPDR/SPSR. Lucky for you most of the existing library code for NRF radios has been done for this kind of AVR so you should easily be able to find a pre-written (and tested!) library to use.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, from the other thread:

 

Anee_19 wrote:
I am not a programmer but I know basic C programming

So you really need to start with the basics before jumping into SPI comms and radio transceivers!

 

See Tip #6 (in my signature, below; may not be visible on mobile).

 

Also in the other thread, meslomp wrote:
Start with reading the Datasheet from start to finish.... then read it again and make sure you understand what is written in it

Note that's both datasheets - the one for the AVR and the one for nRF chip.

 

See:  http://www.8052mcu.com/forum/read/160143

 

I gave links to  nRF24L01 documentation in the other thread: https://www.avrfreaks.net/commen...

 

 

Also in the other thread, I wrote:

 the only bit that's actually specifc to the AVR is just the lowest-level where you're dealing directly with the SPI peripheral hardware. You can simply encapsulate that into functions like spi_init(), spi_write(), and spi_read().

 

Above that, the code should be completely generic and independent of any particular microcontroller.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

As Andy has copied most relevant bits from that other thread I think I'll lock that one so discussion can continue here alone.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Awneil,

Thanks for taking some time to reply. I will go through the links. 

 

Thanks again.

 

 

Aneesh Kola