Jump to content
43oh

nrf24l01+ strange behavior when connected to same computer


Recommended Posts

I'll start by saying analog/RF stuff is not my forte...

 

I've got two msp430g2955 based boards with the cheapo nrf24l01+ boards from ebay added on. Each board is connected with a launchpad as SBW programmer and a USB<->Serial connection for debugging all to the same USB Hub and computer.

 

While trying to get these working I kept seeing strange behavior, auto acks failing, nrf24l01+ not generating IRQs and just otherwise unreliable communications. I eventually disconnected one of the boards and powered it from a battery and everything just started working as expected.

 

Anyone else ever run into this? Any suggestions for a fix? Any explanation for what exactly could be going on?

Link to post
Share on other sites

only thing I can think of is shared ground among same hub usb ports perhaps. try both on 2 separate computers and see what happens?

 

Tapatalk Mobile Device

I assume its a issue with ground as well, just curious if there's a good solution that doesn't involve two separate computers or a really expensive isolated USB hub.

Link to post
Share on other sites

OK this is really odd so I played around with this some more and noticed that I can get reliable behavior (even in the same breadboard with the same power supply) as long as I don't initiate the TX via a button.
 

So with the code below, if I have the || 1 code everything works fine, without it the TX either fails or the while loop on the IRQ_BIT never returns. The button circuit is pretty simple, I'll likely remove the capacitor to see if it makes any difference, but just don't have any idea why it would matter either way.

 

Anyone have any other ideas?

 P2DIR &= ~BUTTON_BIT;
// Snip basic setup

P2DIR &= ~IRQ_BIT;
// Snip nrf setup

 while (1) {  
if (((P2IN & BUTTON_BIT) == 0) || 1) {  
  nrf24l01_send_command(RF24_W_TX_PAYLOAD, data, 1);
  CE_SET;
  while ((P2IN & IRQ_BIT) != 0);
  CE_CLEAR;

  // Sit and spin until button is released    
  while ((P2IN & BUTTON_BIT) == 0) ;
}
}
 

post-31956-0-54733500-1368031498_thumb.png

Link to post
Share on other sites

Ohhh, gotcha.  I've seen this before.  The pushbutton should ideally not short to ground directly but short through a resistor, say 1K ohm.  I believe what happens is when you introduce the capacitor to GND it causes a "ground bounce" scenario that screws up the MCU and related circuits.

 

In my original example where I encountered this problem, I just removed the capacitor and relied on software debouncing of the button.  In future designs I chose a 2.2K ohm resistor between the button and GND.

Link to post
Share on other sites

Ohhh, gotcha.  I've seen this before.  The pushbutton should ideally not short to ground directly but short through a resistor, say 1K ohm.  I believe what happens is when you introduce the capacitor to GND it causes a "ground bounce" scenario that screws up the MCU and related circuits.

 

In my original example where I encountered this problem, I just removed the capacitor and relied on software debouncing of the button.  In future designs I chose a 2.2K ohm resistor between the button and GND.

Yeah I removed the capacitor and everything just magically started working, both circuits connected to the very same breadboard, all powered by a single launchpad. Hit button and the LED lights up on both boards. DOH! Thanks for the explanation.

 

Do you have a capacitor and the pull down resistor or just the resistor? I'm assuming you still have the pull up as well?

Link to post
Share on other sites

Yeah I removed the capacitor and everything just magically started working, both circuits connected to the very same breadboard, all powered by a single launchpad. Hit button and the LED lights up on both boards. DOH! Thanks for the explanation.

 

Do you have a capacitor and the pull down resistor or just the resistor? I'm assuming you still have the pull up as well?

 

Yeah so my setup is like...

post-15991-0-30030600-1368033427_thumb.png

 

(PS, totally love the new Samsung Galaxy Note II I got on sunday!)

Link to post
Share on other sites

This isn't the first time I've heard of grounding problems with cheapo NRF boards.  IMO, these boards are suitable for hobby use only.

Yeah but AFAIK there's nothing else anywhere near that same price point and in this case might've been more a problem with my side of the circuit than theirs.

Link to post
Share on other sites

Yeah but AFAIK there's nothing else anywhere near that same price point

For a real product, the NRF is simple enough that you can load the reference design onto your own board.  And then you can build your board with tolerances, components, and material befitting a classy RF circuit rather than a Chinese sweatshop.  All they have done is load the reference design onto a board -- it's not that hard.

Link to post
Share on other sites

For a real product, the NRF is simple enough that you can load the reference design onto your own board.  And then you can build your board with tolerances, components, and material befitting a classy RF circuit rather than a Chinese sweatshop.  All they have done is load the reference design onto a board -- it's not that hard.

Agreed, though honestly I don't know enough to do a better job than the reference design and cost wise the entire modules are 1/2 the price of the chips in small quantities. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...