Help with advice on selecting RF transceiver.

Thread Starter

hexluthor

Joined Feb 25, 2019
27
Hello all,
I am working on a project for school. My project is a glove with some flex sensors on it that use an ATMega328P micro to send adc conversions out serially to another 328p which in turn controls a servo bank with soft PWM. My project needs to be wireless and the 1st transceiver I tried to use (one I had bought a while back just to play around with) doesn't fit my specifications for data transfer. In order to get my project functioning I need to be able to transmit 2 bytes serially at 19.2Kbps every 4 milliseconds, this timing is required because I need to drive 5 servo motors at 50hz! Range is not a huge concern 3 meters or more is sufficient. The device I was trying to use was a Lora611AES transceiver module from RfNice. It can't do what I need it to do though. Any ideas on what device might work? Or am I screwed ?

Thanks,
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
I spent so long trying to figure out how to program the controllers I neglected to spend much time on even looking at the transceiver. Now I've got my coding all buttoned up and the project works with a wire between the controllers tx/rx pins but the transceiver I was planning on using as it turns out can't communicate fast enough for me. This same company makes another transceiver which would get my real close but I would still have to modify my code to be able to handle the difference.
 

pmd34

Joined Feb 22, 2014
527
Hi hexluthor, I had some success using Nordic Semiconductors "NRF24L01+" RF transceiver chips and an ATMEGA168. I was a bit disappointing with the speed as it took about 400us to actually synchronise and prepare to received data but think it should well be within your time constraints. The data sheets are a little hard to understand and navigate, but I have some code I can send you to help you on your way.
I see you can also buy modules with the chips on them from Aliexpress etc. so it should get you off to a flying start!
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
Thanks I appreciate that. I looked on Aliexpress and see many different brands offering the NRF24L01 modules. I'll have to start digging through some of the data sheets I guess to make sure the other ones would operate at the same rate. with the one that you are familiar with did it require a buffer to fill up before it would transmit or would it transmit byte by byte, if you recall? one of my issue is that I am trying to send 2 consecutive bytes, 1 for an identifying marker and the second byte is containing an ADC conversion. The double byte packets then need to be sent out in 4 ms intervals. If I have to fill up a buffer before transmitting then I would need to do a serious overhaul of my program. right now my program is pretty straight forward and fast but its literally handling 1 ADC conversion attaching an identifying marker then transmitting it and the receiver is handling it as soon as it arrives and creating a soft PWM output. Also the code you might let me borrow what language is it in? I am only familiar with Atmel assembly and not an experienced programmer. I would really like to stay away from attempting to figure out any kind of high level language at this point in time.
 
Last edited:

Thread Starter

hexluthor

Joined Feb 25, 2019
27
I'm located in the United States on the East coast. Thanks for the tutorial. I will go through it later on today, I need to get a few hours rest before classes start.
 

pmd34

Joined Feb 22, 2014
527
Hi hexluthor, as far as I remember when you initialise the chip at power up, you tell it how big your data "packet" will be - a fixed number of bytes, or variable.. When you want to send data you fill in the bytes with the data, and then tell the chip to "send".
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
hi,
This NRF tutorial should be helpful.
E
What is your location.?

EDIT:

OK, USA.
Pity its not UK, I have a few NRF24L transceivers I don't need.foc :)
That is a pitty. I do appreciate the sentiment though. I think I can get one purchased and sent to me within a couple of days so it should be fine.
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
Hi hexluthor, as far as I remember when you initialise the chip at power up, you tell it how big your data "packet" will be - a fixed number of bytes, or variable.. When you want to send data you fill in the bytes with the data, and then tell the chip to "send".
That is good to know. It seems as though this module might work well for me. I look forward to getting one and figuring it out. What was the language you wrote your code in? I might need to pick your brain a little bit once I get it and try to configure it and get it setup with my controller.

Thanks,
 

pmd34

Joined Feb 22, 2014
527
I wrote my code in C - AVR studio, its been a while since I used it, but I think it should get you off to a start if you need it! The hardest thing was figuring out what all the registers should be set up to be at startup, and making sense of all the "pipe line" jargon!
I seem to remember there is also some Arduino libraries for it all, but Im not really one for using others code like a black box, so I didnt look at it much.
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
I guess you wrote the code in C loaded it onto you controller and let your controller configure the transceiver or did you use a specific programmer to connect to it?
 

pmd34

Joined Feb 22, 2014
527
Yes, the controller did all the work, as the RF device does not have any programmable memory, so you need to initialize it every time you power up.
 

ericgibbs

Joined Jan 29, 2010
18,766
hi hex,
I had a Base NRF talking to 4 NRF remotes, using Oshonsoft Basic, it worked OK, but the downside for my application was the limited range of the NRF TXR signal. Changed over to the HC12 series TXR.

Like 'pmd' I could post the code for my project, which may help you follow the set up coding, it is partly commented.

If you are going the Arduino route, the existing website libs may get you off to faster start with less hassle.

E
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
hi hex,
I had a Base NRF talking to 4 NRF remotes, using Oshonsoft Basic, it worked OK, but the downside for my application was the limited range of the NRF TXR signal. Changed over to the HC12 series TXR.

Like 'pmd' I could post the code for my project, which may help you follow the set up coding, it is partly commented.

If you are going the Arduino route, the existing website libs may get you off to faster start with less hassle.

E
I would like to see the code for the nrf if you don't mind. I'm not using an arduino but i am using an avr chip and programming is being done in Assembly. I don't know C but if there are comments in your code I could probably get alot out of it. Thanks.
 

Thread Starter

hexluthor

Joined Feb 25, 2019
27
Yes, the controller did all the work, as the RF device does not have any programmable memory, so you need to initialize it every time you power up.
Ok. I should have a chip in a couple days. Do you mind sharing your code as well so I can try to see how you went about it?
 

pmd34

Joined Feb 22, 2014
527
Hi hexuthor, I will enclose the section of code that handled the data transmission I need to find the Transmitter part!!
The basics of it is...
- I set up the various data registers as constants, picking through the data sheet to find what should be set to what.
- at power up I run the "initialise SPI" which sets up the ATMEGA into SPI mode to communicate with the RF chip
-I then "initialise RF chip" which sends all the data registers to the chip so it is ready to run.
- When I want to send some data I "send status" - this was just 3 bytes +++ or ---
This is done by waking up the RF chip, loading byte by byte into the ATMEGA SPI register. Then telling the RF chip to send.

If you change the file extension to .c and open it with AVR studio or wordpad++ it helps when its in pretty colors! See if it makes any sense while I try and find my TX code!
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,766
hi hex,
I will dig out those TX and RX files and post later.
E

EDIT:
Added the Base station code, the *.txt is the *.bas [ this site will not accept *.bas extensions]
Also the *.asm that Oshonsoft produces, its a mix of Basic code with the ASM code included.
 

Attachments

Last edited:
Top