RFM70 - how to write code for the RFM70
The RFM70 (and the newer RFM73) from HopeRF is a cheap and powerful 2.4GHz transceiver that I use in some of my projects.
Unfortunately the documentation from HopeRF is not the best, many things are missing in the datasheet and some things I have found to be actually misinforming.
The sample code from HopeRF is kinda OK but even the code is not consistent with the info in the datasheet.
Godfather helped me with some things I was struggling with and suggested me to post my trial-and-error findings here for others to use.
I myself use Microchip PIC devices and the CCS compiler.
Here are the first notes, more will be added later.
NOTES
- Only change mode between RX and TX (set/clear the PRIM_RX bit) while CE is low.
- In TX mode, set CE high AFTER the payload has been loaded in the TX FIFO.
HOWTO
Transmit a package (no auto acknowledge):
1. CE must be low.
2. Clear the PRIM_RX bit to enable TX mode.
3. Put payload in TX FIFO.
4. Set CE high.
5. Wait for IRQ.
6. Clear the TX_DS bit.
7. Set CE low.