RFM12B and AVR — quick start
1
Introduction
The RFM12B tranceiver module has become quite popular recently due
to its low price comparing to other modules on the market. But many
people find it hard to make these tranceivers work (mainly because of buggy
programming guide provided by manufacturer, I guess...). This short article
contains compact and simple code that can be used just to get these modules
running for the first time. It is based on manufacturer's examle code with
slight (but crucial) changes.
2
Schematic
To interface RMF12B modules I used Atmel's ATtiny2313. Schematic is
shown on figure 1. Recommended power supply for the module is 3.8V so I
decided to power both the processor and the module from 3.3V. It can be a
problem with the Mega family as you will need "L" version then. Some people
claim that they run those modules from 5V and everything's fine. The other
solution is splitted power supply (5V for processor and 3.3V for RFM12B)
but resistors are needed on IO pins (5kΩ or so) in this case. Implementing
SPI interface doesn't require strict time delays or clock stability so processor
is running on the 8MHz internal RC oscillator.
3
Transmitter code
Full source code for both the transmitter and the receiver can be found in
1
rfm12b.zip
. Transmitter part contains functions supporting RS232 trans-
mission, but you can omit them as they are not used in the there. First, we
define some macros to keep the program clear.
1
http://loee.jottit.com/rfm12b and avr - quick start
1
Need help?
Do you have a question about the RFM12B and is the answer not in the manual?
Questions and answers