I would like some advice on a beginning experiment using the NRF24L01 Transceiver Module in a short range, full duplex mode. I am not a beginning Arduino user, but this will be my first time with the NRF24L01 module.
Basically, I would like to be able to send data from Arduino(1) to another Arduino(2) while, at the same time, send data from Arduino(2) to Arduino(1).
There are so many tutorials online, I could use some advice on where to start.
Paul_KD7HB:
None of those devices can come close to full duplex operation.
Paul
Paul,
I get what you are saying.
As a practical issue, if you would allow me to use the term "full duplex" as a function of data over time, if the data I am trying to exchange is slow enough, the practical issue could be that the NRF24L01 may be able to go receive to transmit so quickly that it could be treated as full duplex or maybe just a handshake.
I didn't think that the unit could transmit and receive at the same time.
On the same note, at $4 a pop, I could use two of them on either end if I truly wanted full duplex.
Please at least look up your subject on the web and/or search the Arduino forum/site for information before posting!
I googled NRF24L01 arduino and got pages of links to how-to and what for, here's the 2nd hit:
What you want has been done and solved on this forum MANY TIMES. A forum search can get you to detailed answers.
If you're new to the web, learn to use searches like google or duckduckgo or yahoo. They're a lot easier than what we had before.
"On the same note, at $4 a pop, I could use two of them on either end if I truly wanted full duplex."
The ones I bought come in RX and TX as a pair of little boards. You need 2 pair to get full duplex.
The data rate over the radios is magnitudes slower than a 16MHz AVR. You should be able to send and check receive for available data well within the time between chars in and out. If you call within the time it takes per char "at the same time" then yes, you can do this --- as long as your code does not block itself to slowness (the many things at once lesson).
As a practical issue, if you would allow me to use the term "full duplex" as a function of data over time, if the data I am trying to exchange is slow enough, the practical issue could be that the NRF24L01 may be able to go receive to transmit so quickly that it could be treated as full duplex or maybe just a handshake.
I didn't think that the unit could transmit and receive at the same time.
On the same note, at $4 a pop, I could use two of them on either end if I truly wanted full duplex.
Greg
The terms "full duplex", "half duplex" "simplex" have been defined for over 75 years and are commonly used as defined.
gmcmurry:
I didn’t think that the unit could transmit and receive at the same time.
The TX and RX I have are separate boards. If I put them on an Uno and made another the same, neither would want to receive while it was transmitting so both would never want to transmit at the same time. Each would read a lot but only write in turn.
That would be the best start for bidirectonal communication.
The NRFs can exchange up to 32 bytes with each send in a simple one transmitter / one receiver setup.
TomGeorge:
What you will be able to accomplish with the NRF modules is "Half-Duplex".
The transmission of signals in both directions but not simultaneously.
PLUS ... the messages are sent so quickly that it will appear to a human as though it is full duplex. Sending a message and receiving a response takes about 3 to 5 millisecs.
Sending a message and receiving a response takes about 3 to 5 millisecs.
For sure as long as the messages are not long.
For the OP, the baud rate is bits per second. For serial you usually have a start bit, 8 bits data and a stop bit, divide the baud rate by 10 to get bytes per second. 57600 baud is 5760 chars per second. If the messages are 5 chars or less they will TX in under 1 ms each.
My anticipated data package is 20 bytes one way and 7 the other at 38.4k and full duplex. There is quite a bit of time between packages each direction. Additionally I don't even have to go that fast. Its a wired RS232 link passing data in both directions at the same time that I designed myself. I would probably be fine at 19.2 or even slower if need be.
Sounds like I should be able to insert an NRFL24L01 wireless link that can keep up with my existing system.
You should implement a mechanism to send no-data-packets to keep the receiver polled
even if there is no data at the transmitter available.
The first packet byte could carry the data length, so sending a single zero would work.
gmcmurry:
My anticipated data package is 20 bytes one way and 7 the other at 38.4k and full duplex. There is quite a bit of time between packages each direction.
The agreed term is "packet". Packet switching is the basis of the Internet. "Full duplex" - the ability to simultaneously send and receive - is actually rarely used because it is rarely needed - packets are sent and then a reply is awaited to confirm that they have been successfully received.
gmcmurry:
Additionally I don't even have to go that fast. Its a wired RS232 link passing data in both directions at the same time that I designed myself. I would probably be fine at 19.2 or even slower if need be.
Sounds like I should be able to insert an NRFL24L01 wireless link that can keep up with my existing system.
The point I was making is that full duplex requires separate channels. The original Ethernet using a coaxial "ether", the RS485 system - and almost all wireless protocols - uses a single channel on which the local transmitter prevents reception of incoming signals from the distant transmitter. An RS232 link generally has separate incoming and outgoing lines to even permit traffic in both directions. The 10/100/1000-baseT link systems utilise at least two - four for 1000 - channel pairs to operate full duplex.
Full duplex radio systems require completely separate channels.
gmcmurry:
It will be fun to experiment.
I am not at this point familiar with the NRF devices; whether they themselves implement all the handshaking and confirmation protocols required for reliable wireless transmission. Have fun!