Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 10:06 28 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : nRF24L01

Author Message
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 01:54pm 29 Oct 2014
Copy link to clipboard 
Print this post

There has been some talk about using nordic transceivers with micromites etc. I thought I might fan the flames a little.

My setup is a UBW32 loaded with mmbasic 4.4 with this nordic breakout board from sparkfun. My transmitter is this key FOB from sparkfun .

Below is the code I am using to read those key presses from the FOB. Not pretty code but it works. I can confirm that the receive functions work, but I have not yet test the transmit functions.


sub NRF.init
NRF_CONFIG_RG=0
NRF_ENAA_RG=1
NRF_ENRXADDR_RG=2
NRF_SETUPAW_RG=3
NRF_SETUPRETR_RG=4
NRF_RFCH_RG=5
NRF_RFSETUP_RG=6
NRF_STATUS_RG=7
NRF_OBSERVETX_RG=8
NRF_CD_RG=9
NRF_RXADDRP0_RG=10
NRF_RXADDRP1_RG=11
NRF_RXADDRP2_RG=12
NRF_RXADDRP3_RG=13
NRF_RXADDRP4_RG=14
NRF_RXADDRP5_RG=15
NRF_TXADDR_RG=16
NRF_RXPWP0_RG=17
NRF_RXPWP1_RG=18
NRF_RXPWP2_RG=19
NRF_RXPWP3_RG=20
NRF_RXPWP4_RG=21
NRF_RXPWP5_RG=22
NRF_FIFOSTATUS_RG=23
NRF_MISO=11
NRF_MOSI=12
NRF_CLK=13
NRF_CS=14
NRF_CE=10
NRF_IRQ=9
NRF_ADDRESS_WIDTH=5
NRF_PAYLOAD_WIDTH=4
dim NRF_ADDRESS(NRF_ADDRESS_WIDTH)
dim NRF.RX(NRF_PAYLOAD_WIDTH)
dim NRF.TX(NRF_PAYLOAD_WIDTH)
setpin NRF_MISO,2
setpin NRF_MOSI,8
pin(NRF_CLK)=0:setpin NRF_CLK,8
pin(NRF_CS)=1:setpin NRF_CS,8
pin(NRF_CE)=0:setpin NRF_CE,8
end sub

sub NRF.setTXaddr
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_TX_ADDR_RG+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub

sub NRF.setRXaddr(P)
pipe=&H0A+P
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,pipe+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub

sub test
nrf.readpayload
print "Button #";keyfobkey()
NRF.clearRXDR
end sub

function NRF.status()
temp=nrf.readreg(NRF_STATUS_RG)
NRF.status=temp
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(right$(x$,1))
NRF_RX_P_NO=val("&B"+"mid$(x$,5,3))
NRF_MAX_RT=val(mid$(x$,4,1))
NRF_TX_DS=val(mid$(x$,3,1))
NRF_RX_DR=val(mid$(x$,2,1))
temp=nrf.readreg(NRF_FIFO_STATUS_REG)
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(mid$(x$,3,1))
NRF_TX_EMPTY=val(mid$(x$,4,1))
NRF_RX_FULL=val(mid$(x$,7,1))
NRF_RX_EMPTY=val(mid$(x$,8,1))
end function


sub NRF.readpayload
local junk
NRF.TXMODE
do
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h61,H,0,8)
for I=1 to NRF_PAYLOAD_WIDTH
NRF.RX(I)=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
next I
pin(NRF_CS)=1
loop until nrf.readreg(23)=17
NRF.RXMODE
pause 200
end sub

sub NRF.sendpayload
NRF.TXMODE
local junk
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&hA0,H,0,8)
for I= 1 to NRF_PAYLOAD_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF.TX(I),H,0,8)
next I
pin(NRF_CS)=1
nrf.rxmode
pause 10
nrf.txmode
end sub

sub NRF.clearRXDR
nrf.writereg(NRF_STATUS_RG,64)
end sub

function NRF.readreg(reg)
local junk, byte1
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg,H,0,8)
byte1=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
pin(NRF_CS)=1
NRF.readreg=byte1
end function

sub NRF.flushRX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE2,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.flushTX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE1,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.writereg(reg, byte)
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg+32,H,0,8)
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,byte,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.RXMODE
pin(NRF_CE)=1
end sub

sub NRF.TXMODE
pin(NRF_CE)=0
end sub

function NRF.RX.avail()
NRF.RX.avail=0
x= NRF.readreg(NRF_FIFOSTATUS_RG)
if x=16 or x=18 then NRF.RX.avail=1
end function

sub NRF.keyfobRX.setup
pin(NRF_CE)=0
nrf.writereg(NRF_ENAA_RG,0)
nrf.writereg(NRF_ENRXADDR_RG,1)
nrf.writereg(NRF_RFCH_RG,2)
nrf.writereg(NRF_RXPWP0_RG,4)
nrf.writereg(NRF_RFSETUP_RG,7)
nrf.writereg(NRF_CONFIG_RG,&B00001011)
pin(NRF_CE)=1
end sub

function keyfobkey()
keyfobkey=0
if nrf.rx(1)=30 then
keyfobkey=1
pin(0)=1
endif
if nrf.rx(1)=23 then
keyfobkey=2
pin(0)=0
endif
if nrf.rx(1)=29 then keyfobkey=3
if nrf.rx(1)=27 then keyfobkey=4
if nrf.rx(1)=15 then keyfobfey=5
end function

sub showRXaddress(x)
temprg=&H0A+x
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_RXADDRP0_RG+x,H,0,8)
for i=1 to 5
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
print byte;
next i
print ""
pin(NRF_CS)=1
NRF.readreg=byte1
end sub

sub showregs
local junk,byte
for I=0 to 23
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,I,H,0,8)
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
pin(NRF_CS)=1
print "REG #"+str$(I)+" = "+str$(byte)
pause 100
next I
end sub

'start
NRF.init
nrf.clearRXDR
nrf.flushrx
NRF.keyfobRX.setup
setpin NRF_IRQ,7,test
NRF.RXMODE
do:loop
Edited by cwilt 2014-10-30
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 02:11pm 29 Oct 2014
Copy link to clipboard 
Print this post

Hi Cwilt, what kind of range are you getting, and what type of antenna do you have on the receiving end?

Thanks for the code!!!
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 02:19pm 29 Oct 2014
Copy link to clipboard 
Print this post

I am using a rubber duck .

I have not tested for distance but I have a good sized home and have no issues anywhere inside even at opposite corners and a level between.

 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:22pm 29 Oct 2014
Copy link to clipboard 
Print this post

Great code. I like your style using the dot notation to simulate objects/methods/properties. Makes it a lot clearer and closer to newer languages.

And it is even interrupt driven. Wonderful. Edited by TZAdvantage 2014-10-31
Microblocks. Build with logic.
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 04:46am 30 Oct 2014
Copy link to clipboard 
Print this post

  TZAdvantage said   Great code. I like your style using the dot notation to simulate objects/methods/properties. Makes it a lot clearer and closer to newer languages.

And it is even interrupt driven. Wonderful.


I did this about a year ago but my job has kept me away from home for the last 10 months. This was written to be used as a library which is as close as I can get to an object in mmbasic. It would be nice if when a library was loaded that all functions, variables, etc would automatically have the library name appended. For example a library named "NRF.BAS" with a function named "init" once loaded would be called "NRF.init".

I have been following the micromite buildup and was waiting for the inclusion of some form of RF module. Geoff recently posted that he was looking for code so I found my files and loaded this onto my test board to confirm that it still worked. Hopefully this helps Geoff.

I hear rumors that I could be called back out to work any day now so I am not sure I will have time to build a 2nd setup and create a "Hello World" test between the two.Edited by cwilt 2014-10-31
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 07:36pm 30 Oct 2014
Copy link to clipboard 
Print this post

Tonight I built another UBW32 and nrf24L01 test board. Loaded mmbasic 4.5 and my code and it did not work. reverted back to 4.4 and it did. My gut says there is a change with interrupt settings. I will figure it out and post new code for 4.5
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 05:29am 31 Oct 2014
Copy link to clipboard 
Print this post

Working 4.5 version.
Now I will make a "Hello World" program between 2 maximites using nRF24L01's.


'NRF24L01 basic driver module
sub NRF.init
NRF_CONFIG_RG=0
NRF_ENAA_RG=1
NRF_ENRXADDR_RG=2
NRF_SETUPAW_RG=3
NRF_SETUPRETR_RG=4
NRF_RFCH_RG=5
NRF_RFSETUP_RG=6
NRF_STATUS_RG=7
NRF_OBSERVETX_RG=8
NRF_CD_RG=9
NRF_RXADDRP0_RG=10
NRF_RXADDRP1_RG=11
NRF_RXADDRP2_RG=12
NRF_RXADDRP3_RG=13
NRF_RXADDRP4_RG=14
NRF_RXADDRP5_RG=15
NRF_TXADDR_RG=16
NRF_RXPWP0_RG=17
NRF_RXPWP1_RG=18
NRF_RXPWP2_RG=19
NRF_RXPWP3_RG=20
NRF_RXPWP4_RG=21
NRF_RXPWP5_RG=22
NRF_FIFOSTATUS_RG=23
NRF_MISO=11
NRF_MOSI=12
NRF_CLK=13
NRF_CS=14
NRF_CE=10
NRF_IRQ=9
NRF_ADDRESS_WIDTH=5
NRF_PAYLOAD_WIDTH=4
dim NRF_ADDRESS(NRF_ADDRESS_WIDTH)
dim NRF.RX(NRF_PAYLOAD_WIDTH)
dim NRF.TX(NRF_PAYLOAD_WIDTH)
setpin NRF_MISO,DIN
setpin NRF_MOSI,DOUT
pin(NRF_CLK)=0:setpin NRF_CLK,DOUT
pin(NRF_CS)=1:setpin NRF_CS,DOUT
pin(NRF_CE)=0:setpin NRF_CE,DOUT
end sub
sub NRF.setTXaddr
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_TX_ADDR_RG+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub
sub NRF.setRXaddr(P)
pipe=&H0A+P
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,pipe+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub
sub test
nrf.readpayload
print "Button #";keyfobkey()
NRF.clearRXDR
end sub
function NRF.status()
temp=nrf.readreg(NRF_STATUS_RG)
NRF.status=temp
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(right$(x$,1))
NRF_RX_P_NO=val("&B"+"mid$(x$,5,3))
NRF_MAX_RT=val(mid$(x$,4,1))
NRF_TX_DS=val(mid$(x$,3,1))
NRF_RX_DR=val(mid$(x$,2,1))
temp=nrf.readreg(NRF_FIFO_STATUS_REG)
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(mid$(x$,3,1))
NRF_TX_EMPTY=val(mid$(x$,4,1))
NRF_RX_FULL=val(mid$(x$,7,1))
NRF_RX_EMPTY=val(mid$(x$,8,1))
end function
sub NRF.readpayload
local junk
NRF.TXMODE
do
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h61,H,0,8)
for I=1 to NRF_PAYLOAD_WIDTH
NRF.RX(I)=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
next I
pin(NRF_CS)=1
loop until nrf.readreg(23)=17
NRF.RXMODE
pause 200
end sub
sub NRF.sendpayload
NRF.TXMODE
local junk
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&hA0,H,0,8)
for I= 1 to NRF_PAYLOAD_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF.TX(I),H,0,8)
next I
pin(NRF_CS)=1
nrf.rxmode
pause 10
nrf.txmode
end sub
sub NRF.clearRXDR
nrf.writereg(NRF_STATUS_RG,64)
end sub
function NRF.readreg(reg)
local junk, byte1
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg,H,0,8)
byte1=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
pin(NRF_CS)=1
NRF.readreg=byte1
end function
sub NRF.flushRX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE2,H,0,8)
pin(NRF_CS)=1
end sub
sub NRF.flushTX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE1,H,0,8)
pin(NRF_CS)=1
end sub
sub NRF.writereg(reg, byte)
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg+32,H,0,8)
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,byte,H,0,8)
pin(NRF_CS)=1
end sub
sub NRF.RXMODE
pin(NRF_CE)=1
end sub
sub NRF.TXMODE
pin(NRF_CE)=0
end sub
function NRF.RX.avail()
NRF.RX.avail=0
x= NRF.readreg(NRF_FIFOSTATUS_RG)
if x=16 or x=18 then NRF.RX.avail=1
end function
sub NRF.keyfobRX.setup
pin(NRF_CE)=0
nrf.writereg(NRF_ENAA_RG,0)
nrf.writereg(NRF_ENRXADDR_RG,1)
nrf.writereg(NRF_RFCH_RG,2)
nrf.writereg(NRF_RXPWP0_RG,4)
nrf.writereg(NRF_RFSETUP_RG,7)
nrf.writereg(NRF_CONFIG_RG,&B00001011)
pin(NRF_CE)=1
end sub
function keyfobkey()
keyfobkey=0
if nrf.rx(1)=30 then
keyfobkey=1
pin(0)=1
endif
if nrf.rx(1)=23 then
keyfobkey=2
pin(0)=0
endif
if nrf.rx(1)=29 then keyfobkey=3
if nrf.rx(1)=27 then keyfobkey=4
if nrf.rx(1)=15 then keyfobfey=5
end function
sub showRXaddress(x)
temprg=&H0A+x
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_RXADDRP0_RG+x,H,0,8)
for i=1 to 5
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
print byte;
next i
print ""
pin(NRF_CS)=1
NRF.readreg=byte1
end sub
sub showregs
local junk,byte
for I=0 to 23
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,I,H,0,8)
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
pin(NRF_CS)=1
print "REG #"+str$(I)+" = "+str$(byte)
pause 100
next I
end sub
sub testtx
NRF.init
nrf.clearRXDR
nrf.flushRX
nrf.keyforRX.setup
nrf.tx(1)=72
nrf.tx(2)=69
nrf.tx(3)=76
nrf.tx(4)=80
nrf.sendpayload
end sub
'start
NRF.init
nrf.clearRXDR
nrf.flushrx
NRF.keyfobRX.setup
setpin NRF_IRQ,INTL,test
NRF.RXMODE
do:loop
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 01:52am 01 Nov 2014
Copy link to clipboard 
Print this post

i cant wait Hurry up!
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 03:56pm 01 Nov 2014
Copy link to clipboard 
Print this post

  plasma said   i cant wait Hurry up!


I wish there were more hours in a day.
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 04:00pm 02 Nov 2014
Copy link to clipboard 
Print this post

I had to roll back to version 4.4 due to a bug in 4.5 but I was able to duplicate the transmissions of the key fob with mmbasic code.

Receive code

'NRF24L01 basic driver module
sub NRF.init
NRF_CONFIG_RG=0
NRF_ENAA_RG=1
NRF_ENRXADDR_RG=2
NRF_SETUPAW_RG=3
NRF_SETUPRETR_RG=4
NRF_RFCH_RG=5
NRF_RFSETUP_RG=6
NRF_STATUS_RG=7
NRF_OBSERVETX_RG=8
NRF_CD_RG=9
NRF_RXADDRP0_RG=10
NRF_RXADDRP1_RG=11
NRF_RXADDRP2_RG=12
NRF_RXADDRP3_RG=13
NRF_RXADDRP4_RG=14
NRF_RXADDRP5_RG=15
NRF_TXADDR_RG=16
NRF_RXPWP0_RG=17
NRF_RXPWP1_RG=18
NRF_RXPWP2_RG=19
NRF_RXPWP3_RG=20
NRF_RXPWP4_RG=21
NRF_RXPWP5_RG=22
NRF_FIFOSTATUS_RG=23
NRF_MISO=11
NRF_MOSI=12
NRF_CLK=13
NRF_CS=14
NRF_CE=10
NRF_IRQ=9
NRF_ADDRESS_WIDTH=5
NRF_PAYLOAD_WIDTH=4
dim NRF_ADDRESS(NRF_ADDRESS_WIDTH)
dim NRF.RX(NRF_PAYLOAD_WIDTH)
dim NRF.TX(NRF_PAYLOAD_WIDTH)
setpin NRF_MISO,2
setpin NRF_MOSI,8
pin(NRF_CLK)=0:setpin NRF_CLK,8
pin(NRF_CS)=1:setpin NRF_CS,8
pin(NRF_CE)=0:setpin NRF_CE,8
end sub

sub NRF.setTXaddr
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_TX_ADDR_RG+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub

sub NRF.setRXaddr(P)
pipe=&H0A+P
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,pipe+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub

sub test
nrf.readpayload
print "Button #";keyfobkey()
NRF.clearRXDR
end sub

function NRF.status()
temp=nrf.readreg(NRF_STATUS_RG)
NRF.status=temp
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(right$(x$,1))
NRF_RX_P_NO=val("&B"+"mid$(x$,5,3))
NRF_MAX_RT=val(mid$(x$,4,1))
NRF_TX_DS=val(mid$(x$,3,1))
NRF_RX_DR=val(mid$(x$,2,1))
temp=nrf.readreg(NRF_FIFO_STATUS_REG)
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(mid$(x$,3,1))
NRF_TX_EMPTY=val(mid$(x$,4,1))
NRF_RX_FULL=val(mid$(x$,7,1))
NRF_RX_EMPTY=val(mid$(x$,8,1))
end function


sub NRF.readpayload
local junk
NRF.TXMODE
do
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h61,H,0,8)
for I=1 to NRF_PAYLOAD_WIDTH
NRF.RX(I)=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
next I
pin(NRF_CS)=1
loop until nrf.readreg(23)=17
NRF.RXMODE
pause 200
end sub

sub NRF.sendpayload
NRF.TXMODE
local junk
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&hA0,H,0,8)
for I= 1 to NRF_PAYLOAD_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF.TX(I),H,0,8)
next I
pin(NRF_CS)=1
nrf.rxmode
pause 10
nrf.txmode
end sub

sub NRF.clearRXDR
nrf.writereg(NRF_STATUS_RG,64)
end sub

function NRF.readreg(reg)
local junk, byte1
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg,H,0,8)
byte1=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
pin(NRF_CS)=1
NRF.readreg=byte1
end function

sub NRF.flushRX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE2,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.flushTX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE1,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.writereg(reg, byte)
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg+32,H,0,8)
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,byte,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.RXMODE
pin(NRF_CE)=1
end sub

sub NRF.TXMODE
pin(NRF_CE)=0
end sub

function NRF.RX.avail()
NRF.RX.avail=0
x= NRF.readreg(NRF_FIFOSTATUS_RG)
if x=16 or x=18 then NRF.RX.avail=1
end function

sub NRF.keyfobRX.setup
pin(NRF_CE)=0
nrf.writereg(NRF_ENAA_RG,0)
nrf.writereg(NRF_ENRXADDR_RG,1)
nrf.writereg(NRF_RFCH_RG,2)
nrf.writereg(NRF_RXPWP0_RG,4)
nrf.writereg(NRF_RFSETUP_RG,7)
nrf.writereg(NRF_CONFIG_RG,&B00001011)
pin(NRF_CE)=1
end sub

sub BLINKLED
pin(0)=0
pause 50
pin(0)=1
pause 50
pin(0)=0
pause 50
pin(0)=1
end sub

function keyfobkey()
keyfobkey=0
if nrf.rx(1)=30 then
keyfobkey=1
BLINKLED
endif
if nrf.rx(1)=23 then
keyfobkey=2
BLINKLED
endif
if nrf.rx(1)=29 then
keyfobkey=3
BLINKLED
ENDIF
if nrf.rx(1)=27 then
keyfobkey=4
BLINKLED
ENDIF
if nrf.rx(1)=15 then
keyfobfey=5
BLINKLED
ENDIF
end function

sub showRXaddress(x)
temprg=&H0A+x
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_RXADDRP0_RG+x,H,0,8)
for i=1 to 5
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
print byte;
next i
print ""
pin(NRF_CS)=1
NRF.readreg=byte1
end sub

sub showregs
local junk,byte
for I=0 to 23
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,I,H,0,8)
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
pin(NRF_CS)=1
print "REG #"+str$(I)+" = "+str$(byte)
pause 100
next I
end sub

sub testtx
NRF.init
nrf.clearRXDR
nrf.flushRX
nrf.keyforRX.setup
nrf.tx(1)=72
nrf.tx(2)=69
nrf.tx(3)=76
nrf.tx(4)=80
nrf.sendpayload
end sub

'start
NRF.init
nrf.clearRXDR
nrf.flushrx
NRF.keyfobRX.setup
setpin NRF_IRQ,7,test
NRF.RXMODE
do:loop
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 04:02pm 02 Nov 2014
Copy link to clipboard 
Print this post

Transmit code


'NRF24L01 basic driver module
sub NRF.init
NRF_CONFIG_RG=0
NRF_ENAA_RG=1
NRF_ENRXADDR_RG=2
NRF_SETUPAW_RG=3
NRF_SETUPRETR_RG=4
NRF_RFCH_RG=5
NRF_RFSETUP_RG=6
NRF_STATUS_RG=7
NRF_OBSERVETX_RG=8
NRF_CD_RG=9
NRF_RXADDRP0_RG=10
NRF_RXADDRP1_RG=11
NRF_RXADDRP2_RG=12
NRF_RXADDRP3_RG=13
NRF_RXADDRP4_RG=14
NRF_RXADDRP5_RG=15
NRF_TXADDR_RG=16
NRF_RXPWP0_RG=17
NRF_RXPWP1_RG=18
NRF_RXPWP2_RG=19
NRF_RXPWP3_RG=20
NRF_RXPWP4_RG=21
NRF_RXPWP5_RG=22
NRF_FIFOSTATUS_RG=23
NRF_MISO=11
NRF_MOSI=12
NRF_CLK=13
NRF_CS=14
NRF_CE=10
NRF_IRQ=9
NRF_ADDRESS_WIDTH=5
NRF_PAYLOAD_WIDTH=4
dim NRF_ADDRESS(NRF_ADDRESS_WIDTH)
dim NRF.RX(NRF_PAYLOAD_WIDTH)
dim NRF.TX(NRF_PAYLOAD_WIDTH)
setpin NRF_MISO,2
setpin NRF_MOSI,8
pin(NRF_CLK)=0:setpin NRF_CLK,8
pin(NRF_CS)=1:setpin NRF_CS,8
pin(NRF_CE)=0:setpin NRF_CE,8
end sub

sub NRF.setTXaddr
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_TX_ADDR_RG+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub

sub NRF.setRXaddr(P)
pipe=&H0A+P
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,pipe+32,H,0,8)
for I = 1 to NRF_ADDRESS_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_ADDRESS(I),H,0,8)
next I
pin(NRF_CS)=1
end sub

sub test
nrf.readpayload
print "Button #";keyfobkey()
NRF.clearRXDR
end sub

function NRF.status()
temp=nrf.readreg(NRF_STATUS_RG)
NRF.status=temp
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(right$(x$,1))
NRF_RX_P_NO=val("&B"+"mid$(x$,5,3))
NRF_MAX_RT=val(mid$(x$,4,1))
NRF_TX_DS=val(mid$(x$,3,1))
NRF_RX_DR=val(mid$(x$,2,1))
temp=nrf.readreg(NRF_FIFO_STATUS_REG)
x$=bin$(temp)
do
x$="0"+x$
loop until len(x$)=8
NRF_TX_FULL=val(mid$(x$,3,1))
NRF_TX_EMPTY=val(mid$(x$,4,1))
NRF_RX_FULL=val(mid$(x$,7,1))
NRF_RX_EMPTY=val(mid$(x$,8,1))
end function


sub NRF.readpayload
local junk
NRF.TXMODE
do
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h61,H,0,8)
for I=1 to NRF_PAYLOAD_WIDTH
NRF.RX(I)=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
next I
pin(NRF_CS)=1
loop until nrf.readreg(23)=17
NRF.RXMODE
pause 200
end sub

sub NRF.sendpayload
'NRF.TXMODE
local junk
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&hA0,H,0,8)
for I= 1 to NRF_PAYLOAD_WIDTH
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF.TX(I),H,0,8)
next I
pin(NRF_CS)=1
nrf.rxmode
pause 10
nrf.txmode
end sub

sub NRF.clearRXDR
nrf.writereg(NRF_STATUS_RG,64)
end sub

function NRF.readreg(reg)
local junk, byte1
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg,H,0,8)
byte1=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
pin(NRF_CS)=1
NRF.readreg=byte1
end function

sub NRF.flushRX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE2,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.flushTX
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&HE1,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.writereg(reg, byte)
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,reg+32,H,0,8)
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,byte,H,0,8)
pin(NRF_CS)=1
end sub

sub NRF.RXMODE
pin(NRF_CE)=1
end sub

sub NRF.TXMODE
pin(NRF_CE)=0
end sub

function NRF.RX.avail()
NRF.RX.avail=0
x= NRF.readreg(NRF_FIFOSTATUS_RG)
if x=16 or x=18 then NRF.RX.avail=1
end function

sub NRF.keyfobRX.setup
pin(NRF_CE)=0
nrf.writereg(NRF_ENAA_RG,0)
nrf.writereg(NRF_ENRXADDR_RG,1)
nrf.writereg(NRF_RFCH_RG,2)
nrf.writereg(NRF_RXPWP0_RG,4)
nrf.writereg(NRF_RFSETUP_RG,7)
nrf.writereg(NRF_CONFIG_RG,&B00001011)
pin(NRF_CE)=1
end sub

sub NRF.keyfobTX.setup
pin(NRF_CE)=0
nrf.writereg(NRF_ENAA_RG,0)
nrf.writereg(NRF_ENRXADDR_RG,1)
nrf.writereg(NRF_RFCH_RG,2)
nrf.writereg(NRF_RXPWP0_RG,4)
nrf.writereg(NRF_RFSETUP_RG,7)
nrf.writereg(NRF_CONFIG_RG,&B00001010)
pin(NRF_CE)=1
end sub

sub BLINKLED
pin(0)=0
pause 50
pin(0)=1
pause 50
pin(0)=0
pause 50
pin(0)=1
end sub

function keyfobkey()
keyfobkey=0
if nrf.rx(1)=30 then
keyfobkey=1
BLINKLED
endif
if nrf.rx(1)=23 then
keyfobkey=2
BLINKLED
endif
if nrf.rx(1)=29 then
keyfobkey=3
BLINKLED
ENDIF
if nrf.rx(1)=27 then
keyfobkey=4
BLINKLED
ENDIF
if nrf.rx(1)=15 then
keyfobfey=5
BLINKLED
ENDIF
end function

sub showRXaddress(x)
temprg=&H0A+x
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,NRF_RXADDRP0_RG+x,H,0,8)
for i=1 to 5
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&H0,H,0,8)
print byte;
next i
print ""
pin(NRF_CS)=1
NRF.readreg=byte1
end sub

sub showregs
local junk,byte
for I=0 to 23
pin(NRF_CS)=0
junk=spi(NRF_MISO,NRF_MOSI,NRF_CLK,I,H,0,8)
byte=spi(NRF_MISO,NRF_MOSI,NRF_CLK,&h0,H,0,8)
pin(NRF_CS)=1
print "REG #"+str$(I)+" = "+str$(byte)
pause 100
next I
end sub

sub testtx
'NRF.init
'nrf.clearRXDR
'nrf.flushRX
'nrf.keyforRX.setup
nrf.tx(1)=30
nrf.tx(2)=0
nrf.tx(3)=0
nrf.tx(4)=0
nrf.sendpayload
blinkled
pause 1000
nrf.tx(1)=23
nrf.sendpayload
blinkled
pause 1000
nrf.tx(1)=29
nrf.sendpayload
blinkled
pause 1000
nrf.tx(1)=27
nrf.sendpayload
blinkled
pause 1000
nrf.tx(1)=15
nrf.sendpayload
blinkled
pause 1000
end sub

'start
NRF.init
nrf.clearRXDR
nrf.flushrx
NRF.keyfobTX.setup
'setpin NRF_IRQ,7,test
'NRF.RXMODE
do
testtx
loop
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 04:13pm 02 Nov 2014
Copy link to clipboard 
Print this post

Sorry for all of the posted code.

I am at the point now where I must decide on how to proceed. Should the driver be interrupt driven or polled??? The FIFO buffer will only hold 3 packets before it starts dumping.

Also, how configurable does it need to be? I really don't think I want to create a variable/attribute. Maybe the registers like I have them with comments to break down the individual bits in the register?

Suggestions and opinions please. Edited by cwilt 2014-11-04
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 04:43pm 02 Nov 2014
Copy link to clipboard 
Print this post

Well commented registers should be enough to let users adapt the code as required.
"interrupt driven or polled" will depend on the application also.

The main thing is, you have working code to get us started.
I have the modules and will try it on micromite V4.6 as soon as time permits. Too much work to do this time of the year and we are running gout of rainy days.

Jim
VK7JH
MMedit   MMBasic Help
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 06:17am 15 Dec 2014
Copy link to clipboard 
Print this post

Since I finally got my sample chips and loaded latest beta I have updated the code to work with nrf24L01+. Currently building an outdoor temperature and humidity sensor that reports back to my linux based weather wall clock. Will post code once I have it somewhat pretty.
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 10:12am 02 Jan 2015
Copy link to clipboard 
Print this post

What I am posting here is not pretty but does work. I connected a DHT22 and nRF24L01+ to micromite MK2. On the other end is a pcDuino3 Nano which I wrote python code to control the receiving nRF24.

This reads and sends temp and humidity approximately every 10 minutes.

'Micromite remote temperature and humidity sensor
'Uses DHT22 and nRF24L01+

Sub NRF.INIT
NRF_CONFIG_RG=0
NRF_ENAA_RG=1
NRF_ENRXADDR_RG=2
NRF_SETUPAW_RG=3
NRF_SETUPRETR_RG=4
NRF_RFCH_RG=5
NRF_RFSETUP_RG=6
NRF_STATUS_RG=7
NRF_OBSERVETX_RG=8
NRF_CD_RG=9
NRF_RXADDRP0_RG=10
NRF_RXADDRP1_RG=11
NRF_RXADDRP2_RG=12
NRF_RXADDRP3_RG=13
NRF_RXADDRP4_RG=14
NRF_RXADDRP5_RG=15
NRF_TXADDR_RG=16
NRF_RXPWP0_RG=17
NRF_RXPWP1_RG=18
NRF_RXPWP2_RG=19
NRF_RXPWP3_RG=20
NRF_RXPWP4_RG=21
NRF_RXPWP5_RG=22
NRF_FIFOSTATUS_RG=23
NRF_CS=5
NRF_CE=6
NRF_IRQ=4
NRF_ADDRESS_WIDTH=5
NRF_PAYLOAD_WIDTH=4
Dim NRF_ADDRESS(NRF_ADDRESS_WIDTH)
Dim NRF_RX(NRF_PAYLOAD_WIDTH)
Dim NRF_TX(NRF_PAYLOAD_WIDTH)
Pin(NRF_CS)=1:SetPin NRF_CS,8
Pin(NRF_CE)=0:SetPin NRF_CE,8
End Sub

function NRF.BITTWIDDLE(num,place,value)
local junk$,temp$,x$
x$=str$(value)
junk$=bin$(num,8)
for I=1 to 8
if I=(8-(place-1)) then
temp$=temp$+x$
else
temp$=temp$+mid$(junk$,I,1)
endif
next I
NRF.BITTWIDDLE=val("&b"+temp$)
end function

sub NRF.POWERDOWN
local junk
junk=NRF.READREG(NRF_CONFIG_RG)
junk=NRF.BITTWIDDLE(junk,2,0)
NRF.WRITEREG(NRF_CONFIG_RG,junk)
end sub

sub NRF.POWERUP
local junk
junk=NRF.READREG(NRF_CONFIG_RG)
junk=NRF.BITTWIDDLE(junk,2,1)
NRF.WRITEREG(NRF_CONFIG_RG,junk)
end sub

Sub NRF.SETTXADDR
local junk
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(NRF_TX_ADDR_RG+32)
For I = 1 To NRF_ADDRESS_WIDTH
junk=SPI(NRF_ADDRESS(I))
Next I
Pin(NRF_CS)=1
SPI close
End Sub

Sub NRF.SETRXADDR(P)
local pipe, junk
pipe=&H0A+P
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(pipe+32)
For I = 1 To NRF_ADDRESS_WIDTH
junk=SPI(NRF_ADDRESS(I))
Next I
Pin(NRF_CS)=1
spi close
End Sub

Function NRF.STATUS()
local temp, x$,
temp=NRF.READREG(NRF_STATUS_RG)
NRF.STATUS=temp
x$=Bin$(temp)
Do
x$="0"+x$
Loop Until Len(x$)=8
NRF_TX_FULL=Val(Right$(x$,1))
NRF_RX_P_NO=Val("&B"+"mid$(x$,5,3)) "
NRF_MAX_RT=Val(Mid$(x$,4,1))
NRF_TX_DS=Val(Mid$(x$,3,1))
NRF_RX_DR=Val(Mid$(x$,2,1))
temp=NRF.READREG(NRF_FIFO_STATUS_REG)
x$=Bin$(temp)
Do
x$="0"+x$
Loop Until Len(x$)=8
NRF_TX_FULL=Val(Mid$(x$,3,1))
NRF_TX_EMPTY=Val(Mid$(x$,4,1))
NRF_RX_FULL=Val(Mid$(x$,7,1))
NRF_RX_EMPTY=Val(Mid$(x$,8,1))
End Function

Sub NRF.READPAYLOAD
Local junk
SPI open 100000,0,8
NRF_TXMODE
Do
Pin(NRF_CS)=0
junk=SPI(&h61)
For I=1 To NRF_PAYLOAD_WIDTH
NRF_RX(I)=SPI(&h0)
Next I
Pin(NRF_CS)=1
Loop Until NRF.READREG(23)=17
spi close
NRF.RXMODE
Pause 200
End Sub

Sub NRF.SENDPAYLOAD
Local junk
'NRF.RXMODE
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(&hA0)
For I= 1 To NRF_PAYLOAD_WIDTH
junk=SPI(NRF_TX(I))
Next I
Pin(NRF_CS)=1
NRF.RXMODE
Pause 10
NRF.TXMODE
spi close
End Sub

Sub NRF.CLEARRXDR
NRF.WRITEREG(NRF_STATUS_RG,64)
End Sub

Function NRF.READREG(reg)
Local junk, mybyte
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(reg)
mybyte=SPI(&H0)
Pin(NRF_CS)=1
spi close
NRF.READREG=mybyte
End Function

Sub NRF.FLUSHRX
local junk
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(&hE2)
Pin(NRF_CS)=1
spi close
End Sub

Sub NRF.FLUSHTX
local junk
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(&HE1)
Pin(NRF_CS)=1
spi close
End Sub

Sub NRF.WRITEREG(reg, mybyte)
local junk
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(reg+32)
junk=SPI(mybyte)
Pin(NRF_CS)=1
spi close
End Sub

Sub NRF.RXMODE
Pin(NRF_CE)=1
End Sub

Sub NRF.TXMODE
Pin(NRF_CE)=0
End Sub

Function NRF.RX.AVAIL()
NRF.RX.AVAIL=0
x= NRF.READREG(NRF_FIFOSTATUS_RG)
If x=16 Or x=18 Then NRF.RX.AVAIL=1
End Function

Sub TXSETUP
SPI open 1000000,0,8
Pin(NRF_CE)=0
NRF.WRITEREG(NRF_ENAA_RG,0)
NRF.WRITEREG(NRF_ENRXADDR_RG,1)
NRF.WRITEREG(NRF_RFCH_RG,2)
NRF.WRITEREG(NRF_RXPWP0_RG,4)
NRF.WRITEREG(NRF_RFSETUP_RG,38) '38 is high power low speed setting
NRF.WRITEREG(NRF_CONFIG_RG,&B00001010)
Pin(NRF_CE)=1
spi close
End Sub

Sub showRXaddress(x)
local temprg, junk, mybyte
temprg=&H0A+x
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(NRF_RXADDRP0_RG+x)
For i=1 To 5
mybyte=SPI(&H0)
Print mybyte;
Next i
Print ""
Pin(NRF_CS)=1
'NRF.READREG=byte1
spi close
End Sub

Sub showTXaddress
local junk, mybyte
SPI open 1000000,0,8
Pin(NRF_CS)=0
junk=SPI(NRF_TXADDR_RG)
For i=1 To 5
mybyte=SPI(&H0)
Print mybyte;
Next i
Print ""
Pin(NRF_CS)=1
'NRF.READREG=byte1
spi close
End Sub

Sub showregs
Local junk,mybyte
SPI open 1000000,0,8
For I=0 To 23
Pin(NRF_CS)=0
junk=SPI(I)
mybyte=SPI(&h0)
Pin(NRF_CS)=1
Print "REG #"+Str$(I)+" = "+Str$(mybyte)
Pause 100
Next I
spi close
End Sub

Sub preppayload
local temp, humid
dht22 2, temp, humid
temp=temp*10
humid=humid*10
NRF_TX(1)=temp>>8
NRF_TX(2)=temp-(NRF_TX(1)*256)
NRF_TX(3)=humid>>8
NRF_TX(4)=humid-(NRF_TX(3)*256)
for I =1 to 4
print NRF_TX(I)
next I
end sub

'start
NRF.INIT
NRF.CLEARRXDR
NRF.FLUSHRX
TXSETUP
pause 10000
do
NRF.POWERUP
preppayload
NRF.SENDPAYLOAD
NRF.POWERDOWN
pause 1000
CPU SLEEP 600
loop
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 05:27am 03 Jan 2015
Copy link to clipboard 
Print this post

Looking at last nights data there were some really odd timings with the CPU sleep 600 function. There was a 5+ hour gap and between samples. Anyone have experience with CPU SLEEP function?
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 08:26am 03 Jan 2015
Copy link to clipboard 
Print this post

I think I know what happened.


Update:
It was a bad cap. Noticed timing inconsistency that progressively got worse. Changed cap and timing is within 1 second over 10 minutes.Edited by cwilt 2015-01-04
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 05:18am 04 Jan 2015
Copy link to clipboard 
Print this post

Hopefully this is not too far off topic, but I have had good experience with these for rf link between pc and uMite just using serial. I am pretty sure (haven't tried) that using two units (the ones without the usb port plug) between 2 umites would work well also. Great range and very easy to use being serial. What I have used is the pc to umite over these radios and it works very well. From a previous post, Jman has also mentioned these.
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 07:53am 04 Jan 2015
Copy link to clipboard 
Print this post

  viscomjim said   Hopefully this is not too far off topic, but I have had good experience with these for rf link between pc and uMite just using serial. I am pretty sure (haven't tried) that using two units (the ones without the usb port plug) between 2 umites would work well also. Great range and very easy to use being serial. What I have used is the pc to umite over these radios and it works very well. From a previous post, Jman has also mentioned these.


Certainly not off topic. I believe those radios are for 1 to 1 links, yes?

This version of nRF software is 1 to 1 also, but it is more like a building block. My plan is to build a mesh network using nrf24's and umite's. This is for a home automation idea I have been thinking about. Each remote node would consist of the nrf24 and 2 mites. One mite would handle just communications and forward information to the 2nd mite. It could be possible to remote program the 2nd mite this way, or to interact directly through the console.

There are several mesh micro controllers out there but they are either to expensive to put everywhere, require direct connection to program, or are just to power hungry.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024