1

I am trying to use a nRF24L01+PA with an ATmega328P minimal breadboard system. I first connected the module to my Uno and verified it with the "scanner" example sketch from the rf24 library, which showed:

STATUS       = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xe7e7e7e7e7 0xc2c2c2c2c2
RX_ADDR_P2-5     = 0xc3 0xc4 0xc5 0xc6
TX_ADDR      = 0xe7e7e7e7e7
RX_PW_P0-6   = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA        = 0x00
EN_RXADDR    = 0x03
RF_CH        = 0x4c
RF_SETUP     = 0x07
CONFIG       = 0x0e
DYNPD/FEATURE    = 0x00 0x00
Data Rate    = 1MBPS
Model        = nRF24L01+
CRC Length   = 16 bits
PA Power     = PA_MAX

It also shows the readings from each channel after; I just omitted that part.

Removing the chip and reconnecting it to my breadboard ATmega, which has been bootloaded and tested with the blink sketch, I get the following:

STATUS       = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1     = 0x0000000000 0x0000000000
RX_ADDR_P2-5     = 0x00 0x00 0x42 0x42
TX_ADDR      = 0x1042082184
RX_PW_P0-6   = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA        = 0x00
EN_RXADDR    = 0x00
RF_CH        = 0x00
RF_SETUP     = 0x00
CONFIG       = 0x00
DYNPD/FEATURE    = 0x00 0x00
Data Rate    = 1MBPS
Model        = nRF24L01
CRC Length   = Disabled
PA Power     = PA_MIN

I double-checked all my wires against an ATmega328P pin map and everything checks out.

Furthermore, running the "gettingstarted" sketch on my Uno returns the correct result in the serial monitor where the chip starts in receiving mode and waits for instructions or to receive packets. And because I don't have the other chip set up yet, nothing shows up. However, when I run the exact same program on my breadboard ATmega, I get the following right after it finishes uploading.

RF24/examples/GettingStarted
*** PRESS 'T' to begin transmitting to the other node
Sent response 4194829060
Sent response 4194829060
Sent response 4194829060
Sent response 4294967295
Sent response 4294967295
Sent response 4294967295
Sent response 0
Sent response 4294967295
... yada yada yada

The fact that it is picking up any signals doesn't make sense as I am not transmitting from anything... yet.

The only MAJOR difference between my breadboard setup and the uno is the uno is running off USB 5V and the antenna is getting power from the 3.3V pin. On my breadboard, I have my usb2serial jumpered to 3.3V right off the bat and it is running the ATmega328P with a 16MHz crystal basically at 3.3V (waiting on my 3.3V regulators to arrive this Friday so I can run the chip at 5 and drop down to 3.3 just for the chip, as it is a potential solution I have in mind but in the meantime I am asking for other possibilities). Yes I know it is low but so far other sketches like the blink work, and I am running the chip in receive mode anyways.

I am lost and would appreciate some guidance.

Thank you.

  • Generally, a debugging question must include both the circuit and the code. Using a 3.3v output of a serial converter to power a project including a radio is dubious even for the radio version without the power amplifier yours has. You haven't documented the capabilities of your converter, but typically their regulators can only supply a small amount of current. – Chris Stratton Oct 24 '17 at 11:49
  • The code is what is included in the rf24 library and I'm assuming someone who can offer insight into a fix for the problem probably has used the code before (since they would have used the rf24 library before), so I didn't copy and paste in the huge block of stock code. Regarding the serial converter, if I were to run it at 5V (which I did try later), would the supplied current be noticeably smaller than my Uno? If not, I would think it should work. I tried powering the ATmega @ 5V and using my Uno's 3.3V to power the nrf24 chip. Still same results. – Confused Oct 24 '17 at 21:44
1

The ATmega328P can't run at 16MHz at a supply voltage of only 3.3V (check the datasheet). Either raise the voltage or lower the frequency.

Also note that 16mHz would be 16 milliherz (16E-3), so you probably mean 16MHz, i.e. 16 megahertz (16E6).

Remember that the nRF24L01+ is a 3.3V device, so don't connect it to the ATmega's Vcc when changing the supply voltage to 5V.
The IO pins are 5V tolerant, so that's not an issue.

  • Edited the typo. Understood regarding the undervolting. At 16MHz I believe it needs a minimum of 3.7ish, at least per mfg data. But, as some have seen, the board will run at 3.3V and so far the atmega has been able to load sketches at 3.3V so that's why I was sort of ruling out that as the problem. Got it regarding the nrf24l01 chip voltage. Though if I'm getting a solid 3.3V supply to the nrf24 chip, why does it output all these weird readings. Even the reading of the chip's information is not right. If an undervolted atmega causes these issues, I'd think it wouldn't even print to serial – Confused Oct 24 '17 at 7:44
  • You don't know that. Behavior outside of the specs is undefined. It may work for a simple blink sketch, and not for more advanced sketches that make use of the SPI peripheral, for example. Last time I tried to run an ATmega328P on 3.3V @16MHz, it worked for 50% of the time. – tttapa Oct 24 '17 at 10:30
  • This is however unlikely to be the issue. – Chris Stratton Oct 24 '17 at 11:46
  • I jumpered the serialusb to 5V so the breadboard gets 5V so we can rule that problem out. Then i connected the 3.3V and GND from my Uno to the V+ GND of the nrf24l01 chip, so it runs off separate power from the breadboard atmega (IO pins of nrf24l01 5V tolerant so it would be fine getting signals from the atmega at 5V). Still same results with all 0's. – Confused Oct 24 '17 at 18:00
  • I tried that too and failed too. Then I moved to another project and postponed this for a while, but my web searches suggests, that the NRF needs a lot and hard current sometimes (at start/conneting), and atmega's internal cannot offer that. Also had seen a lot of NRF shields consiting basically only of another foot-print (for breadboard) and 3v3 stabilizer (and requiring 5V power) to believe that it is true. Many people wrote, that those shields works like charm. – gilhad Oct 25 '17 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.