CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

nRF24L01+ full driver by Eduardo Guilherme Brandt
Goto page Previous  1, 2, 3 ... 14, 15, 16 ... 18, 19, 20  Next
 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
fuxafak



Joined: 08 Nov 2013
Posts: 11
Location: Istanbul

View user's profile Send private message

every 3rd transmission, message couldn't transmitted
PostPosted: Wed Jul 02, 2014 10:16 pm     Reply with quote

Hi all,
I have a complicated project by using nRF24L01+ chip and this driver for ccs c. I am a bit confused about something. Here it is:
I use pipe0 as a broadcast and pipe1 as unicast. I have lots of device and everyone has unique id in pipe1. I want to use auto ack on only pipe1. But, when i wrote that code;
Code:
RF24_comm(W_REGISTER|EN_AUTOACK, 0b00011110);   //autoack in pipe 0,1,2,3,4 and 5


pipe1 seems to not use autoack.

When i open pipe0 autoack, pipe1 autoack works fine. But in that case, RX buffer sometimes send microcontroller longer data with dummy bytes.

When i close pipe0 autoack there is also another big problem: When i try to send a mesage to two device in order (i.e first A, then B, then A again), every third message couldn't transmitted!

Thanks for helping
Ufuk Safak
_________________
-ufuk safak-
Istanbul Technical University
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Thu Jul 03, 2014 8:07 am     Reply with quote

dear fuxafak,

if you want to use broadcast, autoack must be off. On the contrary, several nRFs will try to send ack at the same time.
Have you tried that?
_________________
Eduardo Guilherme Brandt
fuxafak



Joined: 08 Nov 2013
Posts: 11
Location: Istanbul

View user's profile Send private message

PostPosted: Fri Jul 04, 2014 6:42 am     Reply with quote

Yes, i tried that. Logically, pipe0 auto ack must be off, but i need auto ack for unicast messaging. When i set en_aa 0b00011110 every third message is lost on the air. Do you have any idea about that?
_________________
-ufuk safak-
Istanbul Technical University
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Fri Jul 04, 2014 12:46 pm     Reply with quote

Hello fuxafak.

I'm sorry I've no idea. The problem is that I've no kit for test it at this moment.
Have you checked the nRF datasheet?

Anybody can help please?
_________________
Eduardo Guilherme Brandt
fuxafak



Joined: 08 Nov 2013
Posts: 11
Location: Istanbul

View user's profile Send private message

PostPosted: Fri Jul 04, 2014 8:53 pm     Reply with quote

i did solve the problem, somehow. But still it can't use autoack properly. Every transmitting is return a datasent irq just like noack:)
I hope that i will be solve this :p
My next problem about packets is everytime i try to send message in that order (A-A-B-A-A-B) B device couldn't hear anything. If i send it again, it can absolutely get messages.
I think it is about TX Addr :s
Thanks for helping. I will be on it tomorrow Smile
_________________
-ufuk safak-
Istanbul Technical University
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Mon Jul 07, 2014 11:34 am     Reply with quote

good news fuxafak. How did you solve the problem?

Thanks!
Eduardo
_________________
Eduardo Guilherme Brandt
fuxafak



Joined: 08 Nov 2013
Posts: 11
Location: Istanbul

View user's profile Send private message

PostPosted: Tue Jul 08, 2014 9:28 am     Reply with quote

I think, only changing nRF module solves the problem. There is still Acknowledge problem. I have another job these days. When i solve it correctly, i will be post it here
Thanks
_________________
-ufuk safak-
Istanbul Technical University
HTAluvBeBeo



Joined: 23 Feb 2008
Posts: 35

View user's profile Send private message

PostPosted: Sun Aug 24, 2014 7:45 am     Reply with quote

Thank you, Eduardo so much.

Very well organized driver.
Your driver works great for me after deleting all spi_read() as you mentioned in the comment of the driver.
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Mon Aug 25, 2014 7:44 am     Reply with quote

Thanks Mr. HTAluvBeBeo

Carpe Diem!
_________________
Eduardo Guilherme Brandt
tienchuan



Joined: 25 Aug 2009
Posts: 175

View user's profile Send private message Yahoo Messenger

PostPosted: Thu Sep 11, 2014 3:31 am     Reply with quote

Great driver!!!
Thanks u so much,Eduardo.
I'm doing a project using NRF24L01+ as you done.
I'm having a problems, such as:
1) I can use two couples nRF24L01+ to tranfer data ( TX1-RX1, TX2-Rx2, which ones using nRF24L01+) at the same time?
2) Can I have not using IRQ Pin? because PIC haven't enough pin in my project.
Can you tell me a problems?
Thanks and regards !!!
_________________
Begin Begin Begin !!!
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Thu Sep 11, 2014 8:21 am     Reply with quote

Hi Mr tienchuan

1) Yes, you can transmit/receive at same time. Just set diferent channels for each pair of them. There is up to 125 channels to set.

2) Unfortunately you must use the IRQ pin.

Thanks to use and good luck friend! =)
_________________
Eduardo Guilherme Brandt
Pret



Joined: 18 Jul 2006
Posts: 92
Location: Iasi, Romania

View user's profile Send private message

PostPosted: Wed Dec 03, 2014 3:49 pm     Reply with quote

Hi Eduardo,

I've been taking your code as is, put in two nRFs, one is calling the RF24_driver_use_example_TXdata_simple and the other is using RF24_driver_use_example_RXdata. The only modification that I've made was to remove that read_spi2.

The problem that I have is that the transmission works only the first time, but fails repeatedly afterwards with value of 5, which means that max retries has been reached. On the receive side, of course, I receive only the first message. What I think it happens, is that the receiver is not sending the ACK and the transmitter thinks that the receiver is not there. Of course, I can add RF24_FLUSH_TX() after each send, but this is not the solution.

On your driver, I can see that the pipe is being configured (I think) to reply with ACK. However, this is not actually happening.

Any idea?
Great driver, btw.
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Thu Dec 04, 2014 5:45 am     Reply with quote

Dear Pret. At this time I've not too much time to answer. But lets go on.

I know that everytime tha TX transmits and waits for the ACK. So this is not the problem. Try to put a delay between transmitions in "RF24_driver_use_example_TXdata_simple". Another thing is configure the nRFs to comunicatre without the ACK. Try to do that please.

Good luck friend!!
_________________
Eduardo Guilherme Brandt
Pret



Joined: 18 Jul 2006
Posts: 92
Location: Iasi, Romania

View user's profile Send private message

PostPosted: Fri Dec 05, 2014 11:22 am     Reply with quote

Hi Eduardo,

Yes, it seems to be a configuration problem. I was messing around with registers, so even if I end up having a good software, the nRF was still failing to communicate properly because of the previous attempts to make it work. So, after I removed the power, the same software that previously did not work, started to work properly. I was very frustrated to see this. I've spent maybe 10 hours trying to make it work.

So, I was unable to see if there is a reset command through SPI. Is there a way to reset all registers to default through software? I don't want to add an additional pin to that...
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Fri Dec 05, 2014 11:43 am     Reply with quote

you can execute default_config() and flush the registers.

As I said, try to do the communication without the ACK. You can make your own configuration based on default_config() function.
_________________
Eduardo Guilherme Brandt
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Goto page Previous  1, 2, 3 ... 14, 15, 16 ... 18, 19, 20  Next
Page 15 of 20

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group