Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atmega328p @ 8mhz @ 250kbps = fail #264

Closed
cimba007 opened this issue Jun 5, 2016 · 13 comments
Closed

Atmega328p @ 8mhz @ 250kbps = fail #264

cimba007 opened this issue Jun 5, 2016 · 13 comments

Comments

@cimba007
Copy link

cimba007 commented Jun 5, 2016

int pipe = wait(1500);
if(pipe != -1)
{
  uint8_t tc = radio.testRPD();

Using Serial << "setDataRate: " << radio.setDataRate(RF24_250KBPS) << endl;

tc is always 0 and I get a very very poor reception. Using the same code with RF24_2MBPS my results are fine. 1MBPS is working great too. Have I missed an important point?

PS: I got 2x 1µF ceramid on my 3,3volt ldo, voltage seems pretty solid. Tested both normal modules and pa+lna modules .. 250kbps stays "broken". In Addition to the caps the nrf24 got a didicated 1500µF

My whole init:
`
void rf_setup()
{
radio.begin();
radio.enableDynamicPayloads();
radio.setAutoAck(1); // Ensure autoACK is enabled
//radio.setChannel(100);
//radio.setPALevel(RF24_PA_MAX);
Serial << "setDataRate: " << radio.setDataRate(RF24_2MBPS) << endl;
radio.setCRCLength(RF24_CRC_16);
radio.setRetries(15,15); // 5 retries with 15 * 250µS = 3.75ms delay between each

if(settings[ce::myid] == 0){
Serial.println(F("I am station"));
// Station
radio.openWritingPipe(station_to_node[0]);
radio.openReadingPipe(1,node_to_station[1]);
radio.openReadingPipe(2,node_to_station[2]);
radio.openReadingPipe(3,node_to_station[3]);
radio.openReadingPipe(4,node_to_station[4]);
radio.startListening();
}else{
Serial.print(F("I am node "));
Serial.println(settings[ce::myid]);
// Node
radio.openWritingPipe(node_to_station[settings[ce::myid]]);
radio.openReadingPipe(1,station_to_node[settings[ce::myid]]);
}
}
`

@Greenstreem
Copy link

I am having the same exact problem with the atmega 328p.

@TMRh20
Copy link
Member

TMRh20 commented Jun 5, 2016

How are you powering the radios? 250kbps on-air time is 8 times longer than
2mbps, so uses more power.

Sent from my iPod

On 2016-06-05, at 12:34 PM, DasHammer [email protected] wrote:

I am having the same exact problem with the atmega 328p.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#264 (comment), or mute
the thread
https:/notifications/unsubscribe/ACfVHBxq8fLIGFF-Cvsp49hJWy7qLedVks5qIxajgaJpZM4IuYQ-
.

@cimba007
Copy link
Author

cimba007 commented Jun 5, 2016

I use an 250mA LDO with 3300µF cap on my receiving node and 1500µF on my sending node. I will hook up my osci to check the voltage.

thx TMRh20, will reply soon

@cimba007
Copy link
Author

cimba007 commented Jun 5, 2016

okay .. I measured Peak-to-Peak ripple of 60mV during send. Adding another 1500µF on my sending node (3000µF parallel) decreases the ripple to 30mV (only when sending).

Still the same Problem. I replaced the PA+LNA-Board with a "normal" one and got still the same figures.

EDIT: Receiving node has even smaller ripple of 21mV peak2peak. (on average cause there are no packets send)

PS: I can even see 15spikes on my tx node trying (sometimes not always) the retry .. so 250kbps has validly no good connection at all.

@Avamander
Copy link
Member

Avamander commented Jun 5, 2016 via email

@cimba007
Copy link
Author

cimba007 commented Jun 5, 2016

I will try this out tomorrow. thanks for your help

@cimba007
Copy link
Author

cimba007 commented Jun 6, 2016

Nothing changed .. contrary to what might be sane I get the worst results on 250kbps.

I changed the example sketch to include RPD:

http://pastebin.com/2V1hvDQY

I looked many hours into the source and found nothing .. My last resort would be to completly redesign my pcb although oscilloscope reading show nothing wrong with the power supply.

I even powered both nodes from an 3,7V -> LDO -> nrf24 .. giving even more stable supply but simply .. no ..

@TMRh20
Copy link
Member

TMRh20 commented Jun 6, 2016

A couple of questions:

  1. Since the title is 'Atmega328p @ 8mhz' have you tested with any 16mhz 328s? Difference or no difference?
  2. How about if you comment out lines 111, 112 & 113 in the gettingstarted example and just do one-way communication? Please post the serial output from both devices.

@cimba007
Copy link
Author

cimba007 commented Jun 8, 2016

I narrowd down the problem to the auto-ack feature although still under investigation. I use these settings:

radio.setAutoAck(true);
radio.setRetries(15,15);

radio.setAutoAck(false); ==> seems to work better

remember .. 1mbps and 2mbps works fine ..somehow autoack doesn't work as expected on 250kbps.

I will test your two suggestions now.

@cimba007
Copy link
Author

cimba007 commented Jun 8, 2016

mycode: http://pastebin.com/V9t1MYVR
changing baud-rate for different tests

Test 1: NO OK

  • Both modules @ 8mhz internal oscillator
  • Both modules set to 250kbps
  • Reply code removed so the communication is just "node1 (ping) -> node2 (pong)"
  • Node1 and Node2 are PA+LNA with a distance of 15-20cm, stable supply and RF24_PA_MAX

Output on node2: http://pastebin.com/ATssyu2Y

Test 2: OK

  • all the same as Test1, both modules set to 1mbps

Output on node2: http://pastebin.com/W1p0mqZ8

Test 3: OK

  • same as Test1, "radio.setAutoAck(false);"

Output on node2: http://pastebin.com/JD8DLw4Z

Test 4: NOT OK

  • same as Test1 but "radio.setRetries(15,15);"

Output on node2: http://pastebin.com/zPkGbJMv

Test 5+6 prove difficult cause I can only get one of my two nodes connected to my IPS so I tried this:

Test 5: NOT OK

  • same as Test4, but receiving node2 @ 16mhz

Output on node2: http://pastebin.com/zPkGbJMv

Test 6: NOT OK

  • same as Test4, but sending node1 @ 16mhz

Output on node2: http://pastebin.com/Hk2s9JBK

From my understanding the waiting period for auto-retries must be higher on 250kbps but the default settings already comply with this requirement. setRetries(15,15) let no doubds that the delay is high enough.

@trojanc
Copy link
Contributor

trojanc commented Jun 8, 2016

Hi

I'm not that technical about the inner workings...and do not have the solution for your problem, but I've had endless issues with RF24_PA_MAX when the modules are too close to each other (like in the same room). Somehow they interfere with each other. When the modules are further away I use RF24_PA_MAX, otherwise RF24_PA_MIN while developing with the modules close by....don't know if that help 😃

@cimba007
Copy link
Author

cimba007 commented Jun 8, 2016

hi trojanc, thanks for this tip. I don't want to retry all tests but I did for Test1 and moved the sending node 1 room away, all settings staying the same .. same result

tried out RF24_PA_MIN again on the same room, same result

Edit: To be extra sure I just opened a pair for PA+LNA modues from my latest shipping. The ones I used for my tests are like 2-3 years old and they show the same phenomena: 250kbps@autoack = working so lala, 250kbps@noautoack = working fine.

As I already said before my last resort will be to ditch my pro minis and do an extra testbed with 5V @ 16mhz with the two new rf24-modules but this will have to wait until the weekend.

I am pretty sure this is unrelated and I did not fully read the thread but I will just keep it here for reference (http://forum.arduino.cc/index.php?topic=198471.15), but the OP mentions something from changing from 250kbps to 1mbps

@Avamander
Copy link
Member

Avamander commented Jun 10, 2016

This again sounds like you have stumbled upon counterfeit modules that perform not as they are supposed to. Clones tend to have issues with autoack and n+1 other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants