I got a pair of nrf24l01's on ebay a couple months ago, spent a couple days working with them with absolutely no success and put them in my parts box until earlier today (yesterday - its 4:30 in the morning) when I decided to give them one more shot. I found many errors in my code and added a few parts to the circuit but after 7 hours the farthest I have gotten is writing and reading the registers successfully (confirmed the correct values were getting written using my LCD) and getting a max_rt interrupt on the tx side while getting a solid "0" output on the rx side. I have a 16x2 LCD on the rx and an LED on each interrupt pin. If it makes any difference they are less than a quarter inch apart on the breadboard. The tx is supposed to send 1, 2, 3 with a 1 second pause between each number in a continuous loop. Using picbasic pro and 16f630 microcontrollers. I must be missing something, maybe I need to write another register or there's a typo that I've missed???
instructions I've been using:
http://www.diyembedded.com/tutorials/nrf24l01_0/nrf24l01_tutorial_0.pdf
TX code:
RX code:
instructions I've been using:
http://www.diyembedded.com/tutorials/nrf24l01_0/nrf24l01_tutorial_0.pdf
TX code:
Rich (BB code):
define osc 4
a var byte
csn var portc.4
transmit var portc.3
so var portc.2
si var portc.1
sck var portc.0
high csn
pause 100
low transmit
low csn
shiftout si, sck, 1, [%00100000, %00010010]
high csn
pause 5
'low csn
'shiftout si, sck, 1, [%00110000, "aaaaa"]
'high csn
'pause 5
low csn
shiftout si, sck, 1, [%00110001, %00000001]
high csn
pause 5
do
low csn
shiftout si, sck, 1, [%10100000, %00000001]
high csn
high transmit
pause 10
low transmit
pause 1000
low csn
shiftout si, sck, 1, [%10100000, %00000010]
high csn
high transmit
pause 10
low transmit
pause 1000
low csn
shiftout si, sck, 1, [%10100000, %00000011]
high csn
high transmit
pause 10
low transmit
pause 1000
loop
Rich (BB code):
high portc.5
a var byte
b var byte
c var byte
d var byte
e var byte
f var byte
csn var portc.3
receive var portc.4
so var portc.2
si var portc.1
sck var portc.0
low receive
high csn
pause 100
pause 5
'low csn
'shiftout si, sck, 1, [%00101010, "aaaaa"]
'high csn
'pause 5
low csn
shiftout si, sck, 1, [%00110001, %00000001]
high csn
pause 5
low csn
shiftout si, sck, 1, [%00100000, %00000011]
high csn
pause 50
low csn
shiftout si, sck, 1, [%00010001]
shiftin so, sck, 0, [a]
high csn
pause 50
low csn
shiftout si, sck, 1, [%00001010]
shiftin so, sck, 0, [b, c, d, e]
high csn
pause 50
f = "a"
serout portc.5, 0, [12]
pauseus 60
serout portc.5, 0, ["reg:", #a, " ", #b, " ", #c, " ", #d, " ", #e, " ", #f]
pauseus 40
pause 500
high receive
do
low receive
pause 2
low csn
shiftout si, sck, 1, [%01100001, 0]
shiftin so, sck, 0, [a, b, c, d, e, f]
high csn
pause 2
high receive
pause 500
serout portc.5, 0, [12]
pauseus 60
serout portc.5, 0, ["rx:", #a, " ", #b, " ", #c, " ", #d, " ", #e, " ", #f]
pauseus 40
pause 20
loop
Last edited: