Hi,
(Complete code at the bottom of this post)
Using the CC1100EM (but with the CC1101 chip) with the on board PCB Antenna i am able to get only about 10-20m Range! Is this normal or should i get much more than this?
I am using the WOR feature and CC1101 wakes every 1sec. and listens to any incoming signal (at 868Mhz) together with GDO2 =0x07 to check for CRC. The transmitter sends the same string (just abcd) 220 times, which takes about 1 sec. to complete (so that i am sure the receiver will get at least one packet).
The software works normally in house, but when i move out and start walking i realize that after 10m i get no more signals or the signals that i get has a wrong CRC!
I attach for reference my WOR settings. Do you see anything that could be the case for getting such low range in my application? I attach also the whole project for reference.
cc_write(CCxxx0_MCSM1, 0x30);
cc_write(CCxxx0_MCSM2, 0x03);
cc_write(CCxxx0_WORCTRL,0x78);
cc_write(CCxxx0_WOREVT1,0x87);
cc_write(CCxxx0_WOREVT0,0xE0);
and the Transmitter part
.
.
ccxxx0_Strobe(CCxxx0_SFRX);_delay_ms(1);
ccxxx0_Strobe(CCxxx0_SRX);_delay_ms(1);
ccxxx0_Strobe(CCxxx0_SWOR);
/************
* While routine
************/
while (1) {
//---------------------------------------------------------------
// Transmitter
//---------------------------------------------------------------
if (Flag==1) // Comming from interrupt
{
Flag=0;
for (i=0;i<220;i++) //Send 220 times the same signal (takes about 1 sec to complete)
{
ccxxx0_WriteBurst(CCxxx0_TXFIFO, "Mabcd", 5); // addr=M, payload=4 bytes
ccxxx0_Strobe(CCxxx0_STX); // activate tx!
while(!(PINA & (1<<PINA7))); // Wait for GDO2 to be set -> sync transmitted
while(PINA & (1<<PINA7)); // Wait for GDO2 to be cleared -> end of packet
ccxxx0_Strobe(CCxxx0_SIDLE);
}
ccxxx0_Strobe(CCxxx0_SPWD);
_delay_ms(1);
ccxxx0_Strobe(CCxxx0_SIDLE);
ccxxx0_Strobe(CCxxx0_SWOR);
}
And also the receiving part
if (Flag==2)
{
Flag=0;
PORTC &=~(1<<7);PORTC &=~(1<<5);
ccxxx0_Strobe(CCxxx0_SIDLE);
i = cc_read(CCxxx0_RXBYTES);
uart_puts("RXed bytes: ");
uart_putc((i+48));
uart_puts("\r\n");
ccxxx0_ReadBurst(CCxxx0_RXFIFO, temp, i);
uart_puts("RXed data: ");
uart_putsn(temp,(i-2)); // nemoj LQI i RSSI
uart_puts("\r\n");
uart_puts("RSSI: ");
rssi_dec=temp[i-2];
if (rssi_dec >= 128)
rssi_dBm = (int16_t)((int16_t)( rssi_dec - 256) / 2) - rssi_offset;
else
rssi_dBm = (rssi_dec / 2) - rssi_offset;
itoa(rssi_dBm, r, 10);
uart_puts(r);
uart_puts("dBm, LQI: ");
itoa(temp[i-1], r, 10);
uart_puts(r);
uart_puts("\r\n");
PORTC |=(1<<7);
PORTC |=(1<<5);
_delay_ms(1000);
ccxxx0_Strobe(CCxxx0_SIDLE);
ccxxx0_Strobe(CCxxx0_SFRX);
ccxxx0_Strobe(CCxxx0_SRX);
ccxxx0_Strobe(CCxxx0_SWOR);
}
Software is written for AVR ATmega164P using WinAVR (don't care about the RX in the name below, it's because on the beginning i used separate software for Rx and Tx )
Thanks,