Shop OBEX P1 Docs P2 Docs Learn Events
Anyone interested in the RFM12 Transceiver Module ? — Parallax Forums

Anyone interested in the RFM12 Transceiver Module ?

MarcelloMarcello Posts: 29
edited 2012-01-06 16:58 in Propeller 1
The RFM12 is sold in Europe for approx. 3,80 Euro (find the datasheet at HOPERF).
Frequency 312, 433, 868 (FM)
A lot of options (too many), 16 Bit FIFO, Baudrate until·115.2 kB/s,·programmable channels·and so on ...

They are really nice and powerful. Some guys have even programmend some kind of comm stack on them (with Atmel uCs).

Anybody interested in a first and small test·spin ?
300 x 300 - 36K
300 x 300 - 22K
«1

Comments

  • BeanBean Posts: 8,129
    edited 2009-11-13 14:51
    Looks like a neat little module.

    I have attached the datasheet for anyone interested.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-11-13 16:55
    I recently ordered some. Will start writing a driver - if nobody else did meanwhile - when I'm done with my display driver.

    Can't it even do more than 115.2kB/s, if you attach a better antenna? Thought I read that somwhere.





    PS: Found it in Beans pdf ... 256kbps with external RC filter
    PPS: Maybe also worth mentioning... these modules are available as transceivers, but also as pure receivers or transmitters.

    Where do you get the transceivers for 3,80€? I paid 5€something. The receiver/transmitter is cheaper.

    Post Edited (MagIO2) : 11/13/2009 5:09:05 PM GMT
  • BigFootBigFoot Posts: 259
    edited 2009-11-13 17:02
    There data sheet states that it will do 250Kb with an external filter. Looks like
    a nice little module and the price is right.

    Russ
  • MarcelloMarcello Posts: 29
    edited 2009-11-14 10:24
    www.octamex.de

    The Prices are allways a bet ... now looks like:

    Price······· pieces

    4.390 EUR· 1·
    4.250 EUR· 3·
    3.900 EUR· 10

    Writing a software driver is not the problem. Understandig how the modules work is the "challenge".

    The maximal baud rate hangs on how fast can you talk on the SPI channel.·The·module supports something between 2,5-5 Mhz.
    How fast is the obex assembler SPI object ?

    At the time i use a simple spin SPI driver so i transmit at ~ 8 Kbs

    Ciao

    Marcello
  • MarcelloMarcello Posts: 29
    edited 2009-11-14 10:28
    Thank you bean for the Datasheet, BUT ... the module datasheet is really buggy and not so useful as the CHIP Datasheet !
    I will try to post ist later ...

    Ciao
  • MarcelloMarcello Posts: 29
    edited 2009-11-14 14:39
    I read again my first post and i realized that i did not·express myself·as good as i wanted.

    So now: i have written a small spin test program for the RFM12.
    - IT WORKS ! (but it took me one month trys)
    - It is only a test program and not a good·formed object ...

    If somebody is interested please·contact me (via post for instance)·
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-11-14 15:37
    You want to have a chance to decide on whom you give it? Simply attach it to your top post. I'd be happy to have some code to start with - even if the module has to wait a few more days .. weeks ... who knows ;o)
  • MarcelloMarcello Posts: 29
    edited 2009-11-14 16:03
    Well ...

    the code is really not the best example of programming practice !

    I get the SW from the cellar (lab)·and i post it as soon as possible.

    @MagIO2: i just play with the propeller and use it for Art Installations.

    Tschüss to all

    Marcello
    ·
  • WurlitzerWurlitzer Posts: 237
    edited 2009-11-15 16:17
    This might be a good fit for my Pipe Organ application. The console, using a propeller for all functions is on the first floor and the pipe chamber again with another propeller is in the 3rd floor. I am currently using a hard wired MIDI standard configuration @ 38Kbaud but would like to go wireless as lightning took out my last system. Also a higher baud rate would useful.

    The programming documentation for setting the baud rate is not very clear and I noticed the demo board only went to sub 18K baud.
  • MarcelloMarcello Posts: 29
    edited 2009-11-15 16:32
    Here my RFM12 demo.

    The code contains a good RFM12 configuration (this is the first requirement for having success with those transceivers !) and some tricks·without whom you will hardly have a RFM12 working.

    The transmitter sends a very short "datagram" (16,1) and the receiver lights up a LED as soon as he recognizes the datagram.

    I would be really interested in deploying the Assembler spin object for talking with the RF module instead of the spin one.

    Has any of you time to do this ? eyes.gif



    Have fun

    Marcello

    PS: i uploaded an improved/corrected software version ...

    Post Edited (Marcello) : 11/24/2009 9:01:58 PM GMT
  • MarcelloMarcello Posts: 29
    edited 2009-11-16 08:01
    Marcellos whish list:

    - porting of the RFM12 SPI procedures to the assembler version

    - writing of a complete RFM12 object with some setup methods like

    --- Init()
    --- SetChannel(),
    --- SetBaudRate(),
    --- SetTransmitPower(RFPowerLevel, FreqDeviation)
    --- SetReceiveSensitivity(Gain, Threshold)
    --- Setxxxxxxx·········· (further tx / rx parameters)

    --- Transmission(On/Off)
    --- Reception(On/Off)··· FIFO

    --- Transmit(Char) OR/AND Transmit(Char[noparse]/noparse)
    --- Receive(char[noparse]/noparse, PacketSize)·· maybe with CRC Check and returning true/false for success

    Anybody interested in writing some clean code ?
  • MarcelloMarcello Posts: 29
    edited 2009-11-16 23:44
    Again me.

    I tryed Beau's SPI Obex Object.

    SHIFTOUT can be easily modified to work, but i need to read the SDO signal while writing a special value into the SDI line.
    Some kind of SHIFTSOUT together with SHIFTIN.

    This task, expecially with assembler written by Beau, is too complicated for me.

    Can anyone help me ?
  • BradCBradC Posts: 2,601
    edited 2009-11-16 23:59
    Marcello said...
    Again me.

    I tryed Beau's SPI Obex Object.

    SHIFTOUT can be easily modified to work, but i need to read the SDO signal while writing a special value into the SDI line.
    Some kind of SHIFTSOUT together with SHIFTIN.

    This task, expecially with assembler written by Beau, is too complicated for me.

    Can anyone help me ?

    This routine takes a 16 bit word you want to send to the unit in outreg, and returns a 16 bit word read from the unit afterwards.

    sendword
                  andn      outa, p_sck
                  andn      outa, p_nsel
                  mov       da, #16
    :sendloop
                  test      outreg, _16bitmask wz
                  shl       outreg, #1
                  test      p_SDO, ina wc
                  muxc      outreg, #1
                  andn      outa, p_SCK
                  muxnz     outa, p_SDI
                  or        outa, p_SCK
    
                  djnz      da, #:sendloop
                  andn      outa, p_SCK
                  or        outa, p_nSEL
    sendword_ret
                  ret
    
    p_sck         long      1<<SP_SCK
    p_nsel        long      1<<SP_NSEL
    p_sdo         long      1<<SP_SDO
    p_sdi         long      1<<SP_SDI
    
    
    



    I wrote a unit using these devices but I was using the raw FSK output/input using a modified biphase manchester code rather than the inbuilt shift registers. I managed to get from one end of the house to the other at about 2400 baud, and across the room (mostly) at 115200, but I never got it to be very reliable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • MarcelloMarcello Posts: 29
    edited 2009-11-17 14:55
    Thank you BradC.
    I will try to embed your code into Beau's.
    (well maybe i do not even need to do it)
    You helped me a lot, but i think i must still struggle a bit to get it going.

    Can you maybe explain me how it works ?
    How do i pass and read the 16 bit Value and how do i set the Pins ?

    Operating the RFM12 the standard way i had more or less 8000 baud reliably 200 meters from hause away to the house cellar !
    I send very short packages and had allmost no errors ...


    Ciao & grazie

    Marcello
    ·
  • Robot FreakRobot Freak Posts: 168
    edited 2009-11-17 15:20
    Marcello,

    I have struggled with these modules and an ATmega32 a few weeks ago.
    Got them working now, but the programming guide for the RFM12 seems to be wrong.

    A friend of mine created this pdf file with a working C code example.

    Hope this will help.

    Kind regards,
    RobotFreak
  • mikedivmikediv Posts: 825
    edited 2009-11-18 01:42
    Guys where are you ordering these from????
  • MarcelloMarcello Posts: 29
    edited 2009-11-18 06:36
    BradC

    I Had your code working, but some issues are still in progress ...

    Tanx again.

    @mikediv: www.octamex.de
    @Robot Freak: i did it with the RFM12 collecting infos from many, many sources. The FRM12 Chip datasheet is relative good.
  • BradCBradC Posts: 2,601
    edited 2010-01-28 08:57
    Just to give this thread a poke in the guts. I've just started experimenting with these little modules again, but using the on-board fifo I don't seem to be able to get further than the next room (about 6M and one single brick wall with no reo) @ 4000 baud. What sort of range are people seeing with these modules?

    I'm using a bit of wire cut to 1/4 wave on both boards at ~433 Mhz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • MarcelloMarcello Posts: 29
    edited 2010-01-28 09:27
    I can only tell you my short test results:

    - circa 3000-4000 b/s (now i reach mor throughput, but the test was done with slow baud rate)

    - Packet more or less·6 bytes long

    - distance: from cellar (1/2 underground) over the garden to the next house. That means thurough 11 Metres house and 30 Metres garden.

    ···························· 30MT garden··················· (TX)

    10 Mt
    |
    (RX)················· |
    ························ |
    cellar················· |
    |

    I was impressed !

    I used the 433 Mhz version and I think that the 800 Mhz would bring more performance.

    Ciao
  • BradCBradC Posts: 2,601
    edited 2010-01-28 09:56
    Very nice. A couple of questions.

    Are the configuration constants the same as you posted in your test code zip above?
    Do you get worse results if you make the packets longer?
    What kind of antennas are you using?

    I found a bug in my assembler code to talk to the SPI on the chips. The received data is not clocked in correctly. The write code works ok though.

    I get quite reasonable results if I don't use the FIFO and just use the FSK pin, but I don't seem to be able to get anywhere near the results you are seeing while using the FIFO.

    One thing I did find, is playing with the crystal load capacitor value can increase the range considerably.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • MarcelloMarcello Posts: 29
    edited 2010-01-28 12:17
    I´ll get the newest code and post it today evening.

    I did not play with packet size, but I do not think it makes a big difference.
    just a piece of wire as antenna.

    I only used FIFO without problems.

    Playing with cristal load capa can increase the performances because of better tuning between the Tx & RX, I think.

    Ciao
    Marcello
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2010-01-28 13:44
    @ Brad

    How long is your antenna? If it's two long or two short it can affect performance dramatically. At 916 MHz, a wire or PC trace that is 2.25 inches (57 mm) long will provide a reasonable impedance.( as per the referred doc)

    For more info on antenna design for this module have a look at this:
    www.hoperf.com/upfile/ANTENNAS_MODULE.pdf

    If it has automatic independence matching, the matching circuit will only compensate with a certain range for a given length of antenna wire.
  • BradCBradC Posts: 2,601
    edited 2010-01-28 13:57
    Hey Bob, It's about 165mm, which is pretty close to 1/4 wave at 433Mhz. I've tried 2mm intervals between about 160mm & 175mm and 165 seems to give the best range so far.

    What has me stumped is using my own modulation on the FSK input, I can get quite a respectable range. Using the same configuration, but the internal mod/demod (which I'd have assumed to be better than my bletcherous hack) I can get as far as the next room.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-01-28 17:31
    Hi Marcello,

    I haven't had any time to work with these modules up to now, but I think this weekend I''m gonna start with it. So, I'd really appreciate if you post your latest code here. I can't make any promises when I can add some results -if help is still needed- as I have so many cunstruction areas ;o)

    Ciao
  • MarcelloMarcello Posts: 29
    edited 2010-01-29 07:36
    Here the Demo ...

    It should work. I hope I did not make any last minute errors.

    It sends and receives a the max speed I could observe, please change this line

    SendCMD($C604,NOWAIT)··········· 'Data Rate C67f= 2.6kbs···

    in both programs (TX & RX) to make your firs tests at a slower speed.

    I used following pins on TX
    nSEL··· = 25
    SCK···· = 26
    SDI···· = 27
    SDO···· = 20

    and on RX
    nSEL··· = 11
    SCK···· = 12
    SDI···· = 13
    SDO···· = 14

    Have FUN !
  • BradCBradC Posts: 2,601
    edited 2010-01-29 08:50
    Hey Marcello! I plugged your configuration constants into my existing code and got over 3 times the range! But I still only get from one end of the house to the other at 2.6k. I'll do some more experimenting and report back. Thanks for the code!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • TheRavenTheRaven Posts: 5
    edited 2010-03-10 08:08
    Hello,

    I was wondering whether there are any updates available for the code posted. A complete object in the obex would be nice.

    Keep up the good work!

    TheRaven
  • KPRKPR Posts: 189
    edited 2010-12-16 07:49
    Hey.. has there been any other work don on this.. I just aquired 5 units.. and would love to have them working..

    K.
  • GaneshRGaneshR Posts: 1
    edited 2011-04-29 02:32
    Hi all,

    Here is a web article describing the detailed configuration and fine tuning of RFM12b:

    http://blog.strobotics.com.au/2008/06/23/rfm12b-bit-rates-and-throughput/
    http://blog.strobotics.com.au/topics/embedded/rfm12b/

    Also a nice tool to calculate the commands:
    http://www.kewlit.com/RFM12B/

    Could anyone get 16 bytes payload to be sent with speed higher than 2.6kbps? I have trouble with that..

    Cheers
  • Alexis64Alexis64 Posts: 42
    edited 2012-01-06 16:58
    When I try to use the RFM12.zip‎ it all works well as long as the receiver responds (and is online) -- as soon as there is a comms error (half of a byte or so) it just hangs ... I think this is to do with the parameter WAIT which waits until data is fully echoed on SDO ... Since I suck at PASM, is there anyone on this forum that can take a look at the ShiftInOut.spin (pasm) and put a timeout of 1 seconds or so when the WAIT parameter is used? If data is not present on SDO within one second, than the unit is dead or batteries are flat or does not exist ...

    Thank you.
Sign In or Register to comment.