Using INHAOS RF2400 2.4 gHz RF Modules

Goeytex

Senior Member
The RF2400x is a 2.4Ghz transceiver module from INHAOS ( China). These modules are meant to be compatible with the Nordic NRF24L01+ modules. While these modules can communicate with the Nordic modules, the programing is slightly different.

The INHAOS modules cost $2.99 each with free shipping from China, compared to > $19.00 each plus shipping for the Nordic modules from Spark Fun. Functionally they are basically the same, however the Nordic Module has an on board 3.6V regulator and can take 5v Vdd. The INHAOS module has no regulator and can only take Vdd up to 3.6 volts. The Nordic Module module has an Antenna Factor chip antenna while the INHAOS has a PCB trace antenna. This gives Nordic module an edge on range. However the INHAOS has a max output of 5 dBm compared to the Nordic 0dBm. It would be easy enough to peel off the trace antenna on the INHAOS and solder on a chip antenna . This would give the INHAOS a big range advantage over the NORDIC with 5dBm vs 0dBm.


1. The INHAOS has no 250Khz AIR Data Rate option.
2. To write to registers 28 & 29 you must first write the "Activate" command byte
then write the register and then do a hard reset.
3. A hard reset may be required after changing the default receive addresses for the Data Pipes
Suggest keeping the default addresses unless multiple star networks are set up in
the same location.

These programs are for basic testing or the INHAOS RF2400 Transceivers. One program sets the Module
as a dedicated receiver and the other as a dedicated transmitter. Automatic packet handling is not enabled for the purpose of this demo. These are intended to show how to program the modules and to use the HSPI interface and to do range testing.

I will post code for automatic packet handling soon.

There are several subroutines ( functions) that are not used. These functions have been tested to
work and can be used in a modified program.

The code is written for a 20x2. You will need to modify the pins / variables to suit your Picaxe

Load I_2400_TX into one Picaxe/Module combo
Load I_2400_RX into another Picaxe/Module combo
Keep Download connector connected to receive module.
Hard reset both boards.

NOTE: The receiver was detuned to allow close testing between modules. For maximum range, you will need to change the line for register 6 in config_registers to:

Code:
'write Register 6
low csn
[B]hspiout ($26,%00000111)[/B]  'REG 6  Data Rate   1 mbps  LNA Normal  Output 5 dbm
high csn



Have fun !



20 x 2 Connections
Physical Pins ....................... RF2400 Pins
--------------------------------------------------
Picaxe .................................. RF2400
---------------------------------------------------
Pin 1 Vdd ( 3.6v)
Pin 2 SerIn
Pin 3 Serout
Pin 4 NC
Pin 5 C.5 ................. > INHAOS IRQ Pin 8 / 10K Pullup
Pin 6 NC
pin 7 NC
Pin 8 NC
Pin 9 HSPI SDO .............. > INHAOS MOSI Pin 6
Pin 10 NC
Pin 11 SPI Clock ........... > INHAOS SCK Pin 5
Pin 12 NC
Pin 13 HSPI SDI ............ > INHAOS MISO Pin 7
Pin 14 B.4 ................. > INHAOS CSN Pin 4
Pin 15 NC
Pin 16 NC
Pin 17 B.1 ................. > INHAOS CE Pin 3
Pin 18 NC
Pin 19 NC
Pin 20 Ov
 

Attachments

Last edited:
I now have these modules communicating with automatic packet handling and auto ACK. Almost identical code to the Nordic nRF24L01+ with a few minor but important differences.

If enough are interested, I will write a detailed tutorial on how to use this transceiver with a Picaxe. The more that reply
the more motivated i will be to write it up.
 
I am certainly interested in these modules and would love it if you get sufficient interest to warrant effort of writing a tutorial.

The devices seem just right for use in a beehive instrumentation and logging application, where a significant number of such devices could eventually be used.
 
I now have these modules communicating with automatic packet handling and auto ACK. Almost identical code to the Nordic nRF24L01+ with a few minor but important differences.

If enough are interested, I will write a detailed tutorial on how to use this transceiver with a Picaxe. The more that reply
the more motivated i will be to write it up.

Count me among those interested. I have a pair in transit from China - should be here in a couple of weeks.

John
 
The devices seem just right for use in a beehive instrumentation and logging application, where a significant number of such devices could eventually be used.

Yes.

They work extremely well where long range is not needed. With over 100 channels and an almost infinite number of addresses
a lot of these could be set up in close proximity without conflict.
 
I have decided not to do a formal tutorial at this time. But the good news is ....

I have written the attached code that is highly commented and includes a whole bunch of function routines that will drastically simplify programming and shorten your learning curve. Each function is commented .

All you have to do is change/write code in the program loop while calling the functions as needed. There are no "gotos, only gosubs (calls). So be sure keep track and not get nested too deep.

This code should act as a tutorial as you read & study it and experiment with these very nice little modules. If you find a bug in any of the functions, please let me know.

Note that I have changed the CSN pin to b.4 to allow use of hserin on b.6 if so desired.

I did my homework now you get the rewards !

Note:
Picaxe interpreter overhead will prevent really hi speed data transfer in certain modes,
However sending a 32 byte packet with ACK every few ms should be very doable when
running an X2 Picase at 64mhz.

For full speed data streaming use Shockburst mode + DYNPD & no ACK which basically takes the Picaxe out of the
picture except for sending the data via hspi to the RF2400. Just keep pumping data to the TX FIF0S
as fast as you can < 2mbps) . and it auto-magically appears on the receiving module. You could stream
audio or even some video with this module with the air data rate set to 2 mbps and HSPI at ful speed.
Refer to the BK2401 datasheet or the Nordic NRF24L01 + Datasheet. Just need need to digitize
the audio or video data first. In this scenario the Picaxe is simply used to initially configure the registers
and act as "glue logic."




Cheers !
 

Attachments

Last edited:
Many thanks Goeytex, I'm sure that what you have provided should more than suffice and is gratefully received.

I'm on the verge of being away for a few weeks, so can't take the chance of an order for RF modules getting sent back to China by the Post Office because there is no one to sign for them, so will pick up three to play with when I get back.
 
Thank you! A pair of modules should be here Tuesday, so I have time to read the code before I start to play ;-)

John
 
Very interesting, and thanks very much for the well-commented code.

I found the data sheet for the module (under "Download", here: http://www.inhaos.com/product_info.php?products_id=35), but not for the chip. Can you point to where you got the information about controlling the chip?

http://www.inhaos.com/downcount.php?download_id=41

The file to download is RF2410U DocumentPack.rar. The BK2421 Datasheet is in a sub folder.

I also relied upon my experience with the Nordic nRF24L01+ as most of programming commands are the
same. http://www.nordicsemi.com/kor/Products/2.4GHz-RF/nRF24L01P
 
Hi
I am running the I_2400_RX.bas in the simulator trying to learn how it is working but it gives me a ''stack error - more nested gosubs than the stack allows'' after the program loops 8 times.
also it seems to miss one digit to the instruction on line74 hspiout (%00100011,%0000001)
I think it should be hspiout (%00100011,%00000011)

Cacho
 
I also notice that the I_2400_TX.bas is doing the same thing, could it be a bug in the simulator program? I am using the 5,4,0 version

Like to see what goeytex thinks about it.
 
For clarity the the extra "0" should be included but hspi will still send out a Hex byte "1" or a Decimal byte "1" regardless. In other words a binary 000001 is the same as a binary 00001 or a 0001. The code operation should not be affected. That was simply a typo, that does not affect anything. Certainly change it in your code though.

As far as the stack error goes, my guess is that the code does not necessarily lend itself to simulation because the interrupts are not being generated in the simulator properly. The simulator is not aware of the pullup resistor on c.5 which
is used to detect the interrupt generated by the RF module on data receive, therefore going directly to the interrupt routine without actually receiving data. Set the interrupt pin (c.5) high in the simulator before running the code and then step through it.

To simulate a data packet received in the receiver code momentarily take pin C.5 low.

Yes that was it. It simulates ok if you put c.5 high before stepping through the code.
 
Last edited:
Goeytex, I'm playing with a couple of the NRF24L01+ and am trying to get them going with a 20x2 without any joy.

Do you have any simpler code snippets that can steer me in the right direction as I'm feeing particularly dumb not being able to get these talking !
 
@FlyBoy


Attached is 20x2 Code for the NRF2401+ It should get you going.

Pay attention to the notes in the code as to where to include pull up and pull down resistors.

Don't let the size of the code daunt you. While not exactly "simple", it is really quite "straight forward"
and is organized into sub routines to make testing & experimenting easier.

I am working on a 20 dBm version of this module/chip that will have some better range.
 

Attachments

Last edited:
Thanks Goeytex,

an evening with your code, the manual, and the digital 'scope narrowed down the culprit - the breadboard !

Scotch for you whenever you're in this part of the world :)

These aren't that bad once you get the hang of them
 
Improved Code

I have completely re-written the code for these INHAOS RF modules. It is much cleaner now and also supports the new 20dBM RF2400PA module. Look soon for an even more powerful 2400 MHz Transceiver from INHAOS with range > 1Km .

Attached is the new code and a schematic.
 

Attachments

Last edited:
Hi Goeytex
I have notice that you have added a 10K pullup resistor r1 in your new schematic. Why since c.5 pin is not open collector?
Also you failled to put a resistor on both LED's connected on b.1 b.2

Thanks for the new code and schematic

Cacho
 
Good Catch on the LED resistors. I will ad them on the schematic.

However I do not see how "open collector" has any relevance to the pullup resistor on Pin C.5. Pin C.5 is an input used to detect the low interrupt signal supplied by the RF2400 IRQ output. At power up C.5 defaults to an input and will be floating until the RF2400 supplies either a high or a low signal. Putting a pullup on c.5 insures that the pin will not float and cause a false interrupt.
 
Hello Goyetex, nice work out there!
I'm also trying to run Inhaos RF2400P but with my AVR project. I've got similiar library but for nRF24L01+. You mentioned in first page that there are "minor but important differences" between those two modules. Could You put some light on those differences, please?
I cannot connect between two modules, I don't know what I'm doing wrong...
 
The differences are that the INHAOS RF module does not support the 250Khz data rate and that it has a second register bank (Bank1) that can only be accessed by first using the the ACTIVATE command byte followed by 0x53.

Bank0 must be active in order for the RF2400 module to work. ACTIVATE followed by 0x53 toggles the active bank. You can check which bank is active by reading Status register, bit 7. The best way to to this is to send 0xFF (NOP) to the module and then read in the status register bits. If bit 7 = 0 then Bank0 is active. If bit 7 = 1 then Bank1 is active. Most of the the bank 1 registers are undocumented and write only.

You can find AVR reference code HERE
 
Last edited:
glad i found this, i have a couple of RF 2400 nano modules coming in a few days hopefully.
i have not worked with rf with the picaxe yet or any sort of spi so im a bit uneasy at the moment but have read the datasheet for the chip and have read through your provided code goeytex which will save alot of first time headaches,thanks.
hopefully it wont be too daunting of a task to finally get my head around and get working successfully.
 
after going through the datasheet again and referring to the test code you have provided i am starting to get a better understanding of the basics of starting to use these modules,thankfully it does not seem so daunting now and im actually quite eager to recieve these now and have a little play around, they were sent out on the 5th and the tracking shows its being classed as an expresspost package so hopefully not too long before i have them, i bought them because they were offered at a damn good price and so small (12mmx12mm) that they can be squeezed into the tiniest of spaces.
so until they arrive i shall keep re-reading both the datasheet and your highly commented and informative code provision and start to work out a basic interpretation of what i can use as a starting ground to move on from.

thanks for the writeup bill it most definately has helped in understanding these modules and no doubt saved alot of time with trying to understand a new area of which i have yet avoided
 
INHAOS has provided me with several new high power 2.4GHz transceiver modules
for testing. These have a PA with TX power > 20dBm and should give an LOS
range of > 1000 meters. I will be writing evaluation / demo code for these over
the holidays and will post in a new thread when done.

May even try doing some frequency hopping with these ....
 
i look forward to reading that, i still shamefully have yet to play with my modules due to being occupied with other projects for my brother but have ordered another 2 rf nano modules to add to the others, just have to invest in a few 20x2 chips as i dont feel like even attempting the m2 bit bang method lol
 
Goeytex,

How is the code for the new modules coming along? And can you point us toward the description on their website?

Jeff
 
Hi Jeff,

INHAOS has provided me with 2 versions of a high power 2.4 GHz module for testing. One with a PCB antenna and a pre-release version with SMA connector. The SMA version is said to have an LOS range > 800 meters. I also have an RS232 low power version that needs to be tested. The code for the high power modules will be nearly the same as the code posted in this thread the only difference being that there is a PA on board and a PA switch that needs to be controlled when switching from RX to TX mode.

I am currently finishing up code on a Picaxe controlled RSSI meter. After that I will test and post test data on these INHAOS modules.

Look back here in about a week or so or send me a PM.

2400PA Module

LC1000 Module

RF2400PA Datasheet
 
studying routines: 24NL01-4-PTX and PRX 24NL01-4-thread mentioned in # 18, there are lines of code that confused me, the mention:
Code:
symbol IRQ = pinb.0    'hardware IRQ1 
symbol CE =   B.1      'Chip Enable 
symbol CSN =  B.6      'Chip Select Active low)...

but later in the routine that responds to the interrupt appears that:
Code:
setint %00000000,%00100000,c

I think there is a confusion of using the IRQ pin that reads, I think mixed ideas interrupt handling in programs for nrf24LF01 and inhaos rf2400 ... or am I mistaken?:(
 
Top