PDA

View Full Version : Having problems with nrf24l01 when trying to send multiple bytes



rudyauction509
- 5th February 2014, 02:47
I've got everything working well using single byte payloads but when I try to send multiple byte payloads (tried 2 and 5 bytes so far). All I get is the last byte sent no matter how I try to send and receive it. I've tried 10 different code layouts on the transmit and receive side and checked the registers 100 times yet I can't figure out the problem. Both a and b end up displaying 3 instead of a displaying 1 and b displaying 3. Does anyone know what's going on?

Code for 2 byte receive:


low csn
shiftout si, sck, 1, [01100001, 0, 0]
shiftin so, sck, 0, [a, b]


high csn

code for 2 byte transmit:


low csn
shiftout si, sck, 1, [10100000, 1, 3]
high csn

rudyauction509
- 9th February 2014, 11:02
Multi byte problem solved, now I can't get them to work with anything but default addresses. Any change to one or both and I lose link. Any ideas? I write 5 bytes to the tx_addr register on the tx and the same 5 bytes to the rx address register for pipe 0 (forget the exact name) and lose link, comment out the code and regain link. ???

longpole001
- 10th February 2014, 12:08
if you want to post your complete code for the test setup might be better than describing the outcome

rudyauction509
- 10th February 2014, 12:22
Never mind, got it fixed a little while ago, didn't realize I had to set both registers on both modules even for 1 way data transfer.

towlerg
- 28th August 2014, 17:07
Hi Rudyauction509

Would you be willing to share your code?

What an odd handle, private joke?

George

longpole001
- 29th August 2014, 01:43
here some stuff i found on the net , cant remember where it was but it a good start