Dorji RF Modules - Picaxe Demo Code with CRC Checking

Goeytex

Senior Member
In another thread the DORJI RF Transceiver Modules were brought up. So I decided to order a pair for testing
and evaluation.

I got the 7020D20 modules that can be programmed for an output up to 20dBm (100mW). This is over the
allowable output in most countries so be sure program the modules for 13dBm to be compliant. If you get
these be sure to get at least one of the USB adapters to allow use of the Configuration
Utility.

What I discovered was a lack of good documentation. The "datasheet" only covers configuration of the module
and offers nothing on how to actually use them.

Usage is fairly simple. Set the EN Pin high and what you send to the rx pin gets transmitted on air AFTER it sees
a <CR>,<LF> sequence. The <cr> ,<LF> is transmitted along with whatever was in the buffer.


A receiver set to the same frequency receives the data packet and sends it out its TX Pin.

When data is being received, the AUX Pin toggles high for the duration of the data packet. This signal can be
used to trigger an interrupt on the Picaxe to tell it to process data received. Very useful when using
the hserin PIN and background receive.

I have written Picaxe specific code that demonstrates the versatility of these module when using a Picaxe 20X2.

One Module acts as a Primary TX and sends out a data packet that includes a destination address, 4 data bytes,
and a 16 bit CRC.

The other module receives the data, validates the address ( "is this for me?") and checks the CRC. If all is well an
ACK is send back to the Primary TX module. Sertxd data is sent out by both both modules and a terminal will give
visual of what's happening. RX and TX LEDS on both modules also give a visual of data being sent / received.

The code is attached and has been tested to work and should serve to help with understanding how the modules
work and how to reliable transmit data over an RF link with some basic error checking.

These are really really nice modules for personal use and experimentation with a range up to and beyond 1000 meters.

Have Fun !
 

Attachments

Last edited:

manuka

Senior Member
Glad user details for these nifty modules are getting nailed ! Although regs. are quite firm about the transmitter power, it may be worth mentioning that it's quite legal to add decent antenna to the receiver of ISM devices. As every 6dB gain doubles range, even a simple 4 element Yagi should link to several km. Stan.
 
Last edited:

MPep

Senior Member
Hi Stan,

You might know, but isn't the output power mentioned to be "effective", therefore the antenna gain must be calculated as part of the overall eirp?

Mark
 

papaof2

Senior Member
Hi Stan,

You might know, but isn't the output power mentioned to be "effective", therefore the antenna gain must be calculated as part of the overall eirp?

Mark
Stan underlined the word receiver in his reference to a gain antenna.

John
 

Goeytex

Senior Member
I have identified a couple of bugs in the original code I posted. New Versions with more extensive commenting
will be posted later today.

Edit:

The Basic Files in the first post have been updated to correct a couple of bugs.
I also added more detailed commenting.

If you downloaded the previous files then you need to update with these.


Cheers
 
Last edited:

Goeytex

Senior Member
Harmonics ?

Just a heads up.

Module = Dorji DRF7020D20 set to Power level 5.

Testing has shown what appears to be significant harmonic output with the modules that I am using.

I set the receiving module to 433.00 mhz and wrote code for the other to transmit a packet every
300 ms, while increasing the frequency by 10khz on each packet. With the receiver set at 433.00,
the TX Power level at 5, when the transmitter gets to 434.58 the packets come in nicely across
the room (10 meters). There are other frequencies that do this as well, some having a wider bandwidth
of reception than others . I only swept the frequency from 429.00 mhz to 435.99 mhz so this is not
the compete picture .

Goey
 

PICforBrains

New Member
Thanks, Goey, for a good starter on these modules.

A minor correction - In 'RUN' mode, the data packets do not need to end in CR LF. This is only necessary when in 'SET' mode and sending/receiving config commands.

Also, a tip for others when receiving data from these modules is to use long timeouts. When transmitting, there is a very long delay, of the order of hundreds of milliseconds, between the module receiving the data and it actually transmitting it. The delay is dependent on the baud rate and the data packet size, as near as I can tell. This delay can be reduced by using fast baud rates. 19200 for RF and 9600 for serial works well and keeps the delays to a minimum.
 

Goeytex

Senior Member
You are correct about the CR,LF. I had some difficulty at first and this seemed to work. However additional testing showed
a problem with the code that I was testing at the time. I will eventually change my posted code to reflect this

When transmitting, there is a very long delay, of the order of hundreds of milliseconds, between the module receiving the data and it actually transmitting it.
As far as the long delays ... Do you mean from the time data is sent to the TX buffer and the time it transmits on air ? Something else ?

Certainly the data received into the TX buffer has to be encoded, assembled, etc before being transmitted and this takes some time, and would be expected. Increasing the air data rate will likely decrease range, especially in a cluttered RF environment, but this may not be an issue if maximum range is not necessary.
==============================================

I hooked up the scope a did a simple timing test.
Both Modules set to 9600 Air Data & 4800 Serial

A 16 byte packet was sent to the TX Pin on Module 1.
Approximately 72ms later the first byte appeared in the receive buffer of Module 2.
 
Last edited:
Top