[SOLVED] nRF24L01 + ATmega328PB wireless communication

Status
Not open for further replies.

kekecjan

Newbie level 4
Joined
Jun 29, 2020
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
91
Hello, I am working on nRF24L01+ with ATmega328pb. I am using Atmel studio 7. I read pdf before: nrf24l01_tutorial_0.pdf.
i am trying to send data from transmitter to receiver. Well i did managed to send 1 byte of data and it worked well. Then i send 3 bytes and what happend is i got 3 bytes with the same payload. Payload consists of numbers : TX_BUF[0]=k++ (always counts just to see if it's still alive and sending), TX_BUF[1]=144; TX_BUF[2]=167; (two fixed values). On the receiver i get 3 bytes of TX_BUF[0].Plus i also get lost packages, that's probably my fault because i am not using IRQ pin (interrupts), and its not synchronized (only my guess, i am not for sure).


I didnt copy code here because it has a lot of lines soo i am just sharing main.c with you : nrf24l01_TX_RX.txt .
(i am not using ADC, i am using UART with interrupts for debugging, i wrote SPI in main.c)

Hope anyone can solve my problem cuse i am in dead end.
 

Attachments

  • Screenshot_1.png
    38.5 KB · Views: 90
  • nrf24l01_tutorial_0.pdf
    503.1 KB · Views: 89
  • nrf24l01_tutorial_0.pdf
    503.1 KB · Views: 170
  • nrf24l01_TX_RX.txt
    14.4 KB · Views: 163

Ok i solved it on my own, in RX mode i just deleted nRF24L01_write_buffer(FLUSH_RX,0,1); . soo i belive when i recived 1 byte
i flush RX FIFO and flush other bytes, still not sure (i guess while in transmitting and receiving mode you must not flush RX nor TX FIFO)
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…