Hi all, I have read through this thread with great interest, particularly the code by Leon. A small twist to his project code based on MCU (PIC18F4520) and nRFL01+ chip, my MCU is PIC16F877A. The rest of the task i.e to configure the nordic chip for receiver or transmitter operation remains the same. I have few questions to Leon, ofcourse others may help too:
General Question: What changes in your code should i make? I am using a PCW C Compiler IDE to talk with my PIC16F877A.
Specific Qs: (1) in your code you used the internal osc. (8 MHz). Can i use #use delay (clock = 20,000,000) for my 20 MHz xtal oscillator definition?
Sorry for digging up such an old thread but I wanted anyone else who searches the forum about these Nordic modules and finds this thread to have this information.
The object TJ mentioned in post #31 has a pretty serious bug. It only passes one byte of the received packet to the calling object.
The object doesn't have a send method so I wrote one myself (using Leon's code as a guide).
Using my new send method I repeatedly sent "test" from one nRF24L01+ to a second nRF24L01+ module.
The second module kept receiving $74, $00, $00, $00.
The problem was the ReadPayload would save the packet into a local array "payload" and then return "payload" which would only return one member of the array. (I'm still not sure why the method returned a $74 instead of a "t".)
I was able to fix this problem by making the payload array global (I had also moved all the methods to my top object).
I plan to post an improved nRF24L01+ object soon. If anyone would like my test object let me know and I'll post it.
I'll post the code I write and any other followup information on a more recent thread I started about these modules.
Thanks Leon for the C code you posted. It made writing a send method easy.
The author* of the object states he tested it with a Nordic FOB. I'm assuming the single byte received was enough to tell which button on the FOB was pressed so the author didn't notice the bug in his object.
* The OBEX lists the author as Allen Marincak but the spin file states the author is Nikita Kareev.
Comments
General Question: What changes in your code should i make? I am using a PCW C Compiler IDE to talk with my PIC16F877A.
Specific Qs: (1) in your code you used the internal osc. (8 MHz). Can i use #use delay (clock = 20,000,000) for my 20 MHz xtal oscillator definition?
The object TJ mentioned in post #31 has a pretty serious bug. It only passes one byte of the received packet to the calling object.
The object doesn't have a send method so I wrote one myself (using Leon's code as a guide).
Using my new send method I repeatedly sent "test" from one nRF24L01+ to a second nRF24L01+ module.
The second module kept receiving $74, $00, $00, $00.
The problem was the ReadPayload would save the packet into a local array "payload" and then return "payload" which would only return one member of the array. (I'm still not sure why the method returned a $74 instead of a "t".)
I was able to fix this problem by making the payload array global (I had also moved all the methods to my top object).
I plan to post an improved nRF24L01+ object soon. If anyone would like my test object let me know and I'll post it.
I'll post the code I write and any other followup information on a more recent thread I started about these modules.
http://forums.parallax.com/showthread.php?130707-Looking-for-Faster-Objects-for-Nordic-Wireless-Modules-nRF24L01-and-nRF2401A&p=988570#post988570
Thanks Leon for the C code you posted. It made writing a send method easy.
The author* of the object states he tested it with a Nordic FOB. I'm assuming the single byte received was enough to tell which button on the FOB was pressed so the author didn't notice the bug in his object.
* The OBEX lists the author as Allen Marincak but the spin file states the author is Nikita Kareev.