RFM70library
RFM70 overview
smd-pins.jpg

The RFM70 is a small module (PCB with some components, ~ 18 x 26 mm) that implements a transciever for the license-free 4.3 GHz band. The module contains a small antenna on the PCB, there is no provision for an external antenna. Two versions of the module exist, one with pins and one without. The pins are on a 1.28 mm grid, which is twice the density of a standard DIL package. The module requires 1.9 .. 3.6 Volt for its power, 3.3 Volt seems to be the preferred operating voltage. It is NOT designed to run at 5.0 Volt. According to the datasheet that maximum 'typical' operating current is 23 mA.

Note that 'licence free' means that certain well-described use of this frequency band is allowd without a license. The RFM70 is designed to be compatible with the requirements for such use, but it is the responsibility of anyone who sells a product that to make sure that it complies with such rules.

The main component of an RFM70 module is the RF70 chip (hidden beneath the black blob). The manufacturer provides separate datasheets for both the RF70 chip and the RFM70 module. The two datasheets seem to be the same, except for the physical and pinout information which is of course different for the chip and the module, so you can probably ignore the RF70 chip datasheet. The RFM70 module datasheet can currently be found at http://www.hoperf.com/upload/rf/RFM70.pdf

The RFM70 module is intended for short-range communication, like wireless computer peripherals (mouse, keyboard, tablet, ect.) keyfobs (car opener, garage door opener, motorized fence opener - some cryptografy will probably be required for such applications) and toys. In a line of sight situation a maximum range of 50 .. 100 m is possible. Indoors communication within a single room will generally be OK (unless you have a very large room..) but passing even a single wall can be a problem.

An RFM70 module must be used with a microcontroller that initializes and operates the module. By itself the module can not be used as a 'wireless wire', although such a mode could be implemented in the microcontroller. The interface between the RFM70 and the microcontroller is a standard 4-PIN SPI interface (MISO, MOSI, CLCK, CSN) plus a CE (Chip Enable) pin. The module also provides an IRQ pin that could be used to speed up the detection of certain events within the module. The library does not used this pin. The SPI input pins are 5V-tolerant, so provided that the high level as output by the module is accpetable to the microcontroller no glue circuitry is needed to interface to a microcontroller that runs from 5 Volt. (Except for course for a regulator that provides the 3.3 Volt to power the RFM70.)

An RFM70 module operates in the 4.3 GHz band. Within that band a frequency can be selected in 1 MHz steps. RFM70 modules can communicate only when they use the same frequency.

The RFM70 module operates on a packet basis. Each packet has a destination address. By default the address is a 5 byte value, but a 4 or 3 byte address can also be configured. For succesfull communication the RFM70 modules that are involved must be configures for the same address length, and the receiving module(s) must have one of their so-called pipes configured for the address used by the transmitter.

An RFM70 contains 6 so-called data pipes that can receive packages. Each pipe has an address, and will receive only messages for that address. Pipes 0 and 1 have a full (up to 5 bytes) address. For pipes 2 .. 6 only the least significant byte can be configured, the other bytes are copied from the address of pipe 1. The length of the address (3, 4 or 5 bytes) is the same for transmission and for all 6 receive data pipes.

A packet contains 1 .. 32 user data bytes. The packet length can either be fixed or flexible. When the packet length is fixed each receiving pipe is configured with its packet length. The length of a package that is sent is determined by the number of bytes written into the transmit buffer, and it it must match the length configured for the receiving pipe. When the packet length is flexible the length of a package is again determined by the number of bytes written into the transmit, but in this case this number is transmitted in the message, and on the receiving side it can be retrieved by the R_RX_PL_WID command (rfm70_channel_payload_size method).

The simple way to send a package is without acknowledgement. The RFM70 just transmits the package and considers it done. It can be received by zero, one, or multiple RFM70 modules, but the sending modules does not care and has no way of knowing. For this simple mode of communication the involved RFM70's

Alternatively a package can be sent with acknowledgement and (if necessary) retransmission. In this case the RFM70 will send the message, and consider it done only when it receives an acknowledge for it. If it does not receive an acknowledge within a fixed amount of time it will re-transmit the package, up to a set maximum. A receiving RFM70 can automatically send an acknowledgement for a successfully received package. For this to work the same requirements as for simple unacknowledged communicatiobn apply, and additionally on both RFM70's

The automatic retransmission provided by the RFM70 uses a fixed retransmission timout, which is probly fine for correcting an occasional packet loss due to interference from other 4.3 GHz sources, but it is potentially inefective when the interference is caused by another RFM70 that uses the same timout! In such cases the microcontroller should implemnet its own retransmission scheme, with for instance a random timeout, and maybe an exponential backoff.