Hi dear friends from Nordic Semi, I´m in great trouble trying to make these nRF24L01+ to work, one unit as a transmiter, and one unit as a receiver, it can be to send 3 bytes at a time. I once used the Italian Telecontrolli RXQ-2 modules, but it´s not more available on the market. So, the best,cheapest available product is yours. But, to get started with it is really difficult. I want to send three bytes at a time, and from many Internet posts about the product, and after studying your datasheet, I have found that i need to set up the modules like that :
For setting up the transmitter module:
-
CE low -Wait 10 microseconds
-
CSN low
-
Wait 10 microseconds
-
Send SPI 0b00100000
-
Send SPI 0b00001110
-
CSN high
-
Wait 10 microseconds ; Configures the unit for TX_prime
-
CSN low
-
Wait 10 microseconds
-
Send SPI 0x31
-
Send SPI 0x3
-
CSN high
-
Wait 10 microseconds ; Configures pipe0 buffer size to 3 bytes
-
CSN low
-
Send SPI 0b11100001
-
CSN high ; Flush TX
-
Wait 10 microseconds
-
CSN low
-
Send SPI 0b11100010
-
CSN high ; Flush RX
-
Wait 2 miliseconds
CE high
For the transmitting routine:
-
CE low
-
Wait 10 microseconds
-
CSN high
-
Wait 10 microseconds
-
CSN low
-
Wait 10 microseconds
-
Send SPI 0xa0
-
Send SPI 3 bytes
-
Wait 10 microseconds
-
CSN high
-
CE high
-
Wait 10 milliseconds
-
CE low
-
Wait 10 microseconds
-
Return to main routine.
For setting up the receiver module:
-
CE low
-
Wait 10 microseconds
-
CSN low
-
Wait 10 microseconds
-
Send SPI 0b00100000
-
Send SPI 0b00001111
-
CSN high
-
Wait 10 microseconds ; Configures the unit for RX_prime
-
CSN low
-
Wait 10 microseconds
-
Send SPI 0x31
-
Send SPI 0x3
-
CSN high
-
Wait 10 microseconds ; Configures pipe0 buffer size to 3 bytes
-
CSN low
-
Send SPI 0b11100001
-
CSN high ; Flush TX
-
Wait 10 microseconds
-
CSN low
-
Send SPI 0b11100010
-
CSN high ; Flush RX
-
Wait 2 miliseconds CE high
For the receiving routine:
-
CE low
-
Wait 10 microseconds
-
CSN low
-
Wait 10 microseconds
-
Send SPI 0x27
-
Send SPI 0x70 ; Clean status
-
CSN high
-
Wait 10 microseconds
-
CE low
-
Send SPI 0x61
-
Send SPI 0xFF - Get from SPI byte 1
-
Send SPI 0xFF - Get from SPI byte 2
-
Send SPI 0xFF - Get from SPI byte 3
-
CSN high
-
Wait 10 microseconds
-
CE high
-
Wait 10 microseconds -Back to the main routine
Both units are adequately wired, and in close distance one to other. I am using PIC16F877, running at 4 MHz, and programming in Assembler. I consider the channel settings the reset default, and I think it does not need to be changed to make things just work. What else should I do to make these things work ? What are the SPI settings that I should use ? Is there any other command or routine that I should implement to get the stuff working ? Thank you very much in advance.
Fabio Leitao Rio de Janeiro, Brazil
- Wait 10 microseconds
- Return to main routine.