Comments (5)
Per the datasheet, the CE pin is used to control transmission, and whether or not the radio stays in Standby-II or returns to Standby-I mode:
See section 6.1.5
"The TX mode is an active mode for transmitting packets. To enter this mode, the nRF24L01+ must have
the PWR_UP bit set high, PRIM_RX bit set low, a payload in the TX FIFO and a high pulse on the
CE for more than 10μs.
The nRF24L01+ stays in TX mode until it finishes transmitting a packet. If CE = 0, nRF24L01+ returns to standby-I mode. If CE = 1, the status of the TX FIFO determines the next action."
I would be interested to know whether adding delayMicroseconds(15);
before ce(LOW);
would make a difference, as well as what board you are using etc., especially if it does make a difference.
from rf24.
Yes, your're right. It was the pulse length. On a Teensy 3.0 with 96 MHz and Paul Stoffregen's optimized digitalWrite function, the sequence ce(HIGH); ce(LOW);
gives me an 800 ns pulse. A delayMicroseconds(10);
before ce(LOW)
sorts this out.
However, in my project I have a requirement that effectively prohibits me to use delay()
or delayMicroseconds()
. My loop()
function needs to terminate in less than 100 microseconds, so, anything that might block needs to implement as a state machine. For RF24, this includes SPI data transfers.
There is a terrific library for handling SPI transfers through DMA on the Teensy3 at https://github.com/crteensy/DmaSpi. I will try to integrate it into your code and I'll let you know about the results.
from rf24.
Hi. I am adapting your library to work with Chipkit's Uno32 and only could make it work by adding the delayMicroseconds(10) to the same spot, as the Chipkit gives a shorter than 10uS pulse with only the ce(HIGH); ce(LOW); pair.
As soon as I finish basic tests how can I send you my modified code ?
from rf24.
Thanks for the extra info. I believe the issue and fix is similar to what I have done on the RPi, being converting the radio.write() to use writeFast, then toggle the CE pin LOW after sending is completed or failed. This should work around the need for a delay. Haven't been able to do much lately, but I will be taking a quick look at it soon. Also code changes can always be submitted via GitHub forks/pull requests.
from rf24.
Ok, I think commit 1d18015 will address the issue.
I've added a delay to startWrite for non-Arduino and Teensy boards, and have modified the standard radio.write() to remove the need for a delay on all boards. It passes all my tests, so hopefully this will do the trick.
*Edit to add: jbliesener You may be best off using startFastWrite(); and just leaving the radio in standby-II mode.
from rf24.
Related Issues (20)
- RPi5 uses different gpio pin numbers (per Linux kernel update) HOT 48
- Radio.printDetails(); does nothing for MKR1010 but Radio.sprintfPrettyDetails(buffer); works fine???? HOT 4
- Pipe is sometimes returned at "255". HOT 15
- Is there a known ESP32 Deep Sleep issue with radio.powerDown()? [Question] HOT 19
- Can RF24 library be used with WiFi? HOT 2
- Can RF24 library be used with WiFi? HOT 4
- [Question] setChannel & setDataRate not read correctly by printPrettyDetails ? HOT 4
- ESP32 Core Panic on radio 0; No panic on Radio number 1, same wiring. How to troubleshoot?[Question] HOT 22
- Use Linux kernel's character device API to implement IRQ capability HOT 113
- [Question] R24.h, testRPD(void) "Strong signal > 64dBm" : "Weak signal < 64dBm" HOT 5
- [Question] Issue using the ManualAcknowledgements.ino HOT 11
- Multiple senders one receiver HOT 1
- reorganize examples HOT 5
- revise MRAA driver's GPIO
- Phasing out most Linux drivers HOT 1
- [Question] Address names used in examples problematic? HOT 8
- Library blocks 11 pin HOT 1
- Unable to use SPI1 on the raspberry pi pico HOT 3
- NRF24L01 does not show all characters in the receiver HOT 4
- Problem using stopListening() and startListening() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rf24.