FastRF extension/patch

65 views
Skip to first unread message

Martin Karlgren

unread,
Feb 20, 2015, 6:32:29 PM2/20/15
to cul-...@googlegroups.com
Hi everybody,

In my project I wanted to use the CC1101's builtin packet handling for easier sync word detection etc, but I also need to send data. I tried to use the FastRF mode, but one limitation was that I couldn't send arbitrary binary data through the "fs" command because it would be chopped off at the first newline or CR character (obviously). My solution was to implement a "fh" command to be able to send hexadecimal coded data.

Also, my receiver doesn't support the initial packet length byte so I need to use the fixed packet length configuration. I've extended the code to detect if the CC1101 is in fixed packet length mode, and if it is, set the packet length explicitly. And, the code now also prevents buffer overflow to be able to send longer messages. I'm not really sure whether the send FIFO is actually 8 bytes but that was my conservative guess (is it configurable?)

Anyways, I have attached my fastrf patch. If anyone finds it useful, feel free to use it.

Note: the CC1101 has to be configured separately with the correct data rate, sync word, modulation, fixed/variable packet length mode etc. This can be done by overwriting the FASTRF_CFG config on the eeprom before entering fastrf mode with "fr". The FASTRF_CFG offset is 0x37 by the way.

Code example (I use the Pike programming language to control my CUL device):

constant fastrf_offset = 0x37;
Stdio.File f = Stdio.File();
f->open ("/dev/ttyACM0");
f->write (sprintf ("W%02X%02X\r\n", fastrf_offset + 0x08, 0x00)); // PKTCTRL0: fixed length
fastrf.patch
Reply all
Reply to author
Forward
0 new messages