I my Application the maximum Range should be achieved.
So i choose a very low data Rate 1200 bit/s with a deviation about 20Mhz.
First i close the FiFo and open it again by sending this Sequence to the RFM01:
Code:
//FIFO Puffer initialisieren bei Fehlern und Datensatzende
void reset_fifo (void)
{
/* FIFO Command: Enable FIFO, IT level=8, Sync. Patt + VDI, stop FIFO */
#asm ("cbi portb,nsel");
sendbyte(0b11001110);
sendbyte(0b10001001);
#asm ("sbi portb,nsel");
#asm ("nop");
/* FIFO Command: Enable FIFO, IT level=8, Sync. Patt + VDI, start FIFO */
#asm ("cbi portb,nsel");
sendbyte(0b11001110);
sendbyte(0b10001011);
#asm ("sbi portb,nsel");
#asm ("nop");
uc_receivebyte=0;
}
After this the RFM waits for an VDI and the synchron Word 0xAA 0xAA 0xAA.
The following Bits will be putted into the FiFo.
After 8 Bits received i get it from the FiFo Buffer an wait for the next Byte.
When all Bytes of a Frame are received an Carriage Return was sent by Transmitter.
This is the Signal to Stop the Fifo and restart it again to receive the next Frame.
When you read out the FiFo via spi the first 8 Bits are status bits of the RFM followed by the 8 bits are in Fifo.
The RFM coud came out of Synchronisation by distortion of the carrier.
In this case the Fifo will be resetted by a Timer after 3 seconds.
I've checked that the AFC had a very wide Range.
When you'll use it a neighbor channer will be caught too.
When you need a lot of channels it's better to switch the AFC off.
When you want a maximum of Range the AFC shoud be turned on, because the Receiver has a little more sense in this case.
About the PLL you could only check out by try and error.
The maximum deviation is regulated by law in your country.
I would use the maximus thats allowed, or the standard that used in your country.
The complete Code you could download here:
**broken link removed**