Hello everyone,
I want to design a system in which I can show the strength of received signal on computer screen. Basically Receiver would get the strength and send it via serial port to PC in which GUI is designed.
Now I have a portable transmitter which would transmit the packets of data every second. I am able to receive the packets at the receiver side. My question is how to get the signal strength so that I can know how far my transmitter is located?
I have tried to get the RSSI value every time controller receives the packets. But it gives the fixed value 250 with some fluctuations. Here is the code I am using at the receiver side. I am using eZ430-RF2500 module with the library codes of cc2500 provided by TI (sla325a)
----------------------------------------------------------------------------------
#include "include.h"#include "msp430.h"extern char paTable[];extern char paTableLen;extern void init_cc2500(void);extern unsigned int convert_to_dec(unsigned int);extern void init_uart(void);char txBuffer[8];char rxBuffer[8];unsigned int i = 0,rssi,rssi_dec;void main (void){ WDTCTL = WDTPW + WDTHOLD; // Stop WDT init_cc2500(); init_uart(); __bis_SR_register(LPM3_bits + GIE);}// The ISR assumes the interrupt came from GDO0. GDO0 fires indicating that// CCxxxx received a packet#pragma vector=PORT2_VECTOR__interrupt void Port2_ISR(void){ // if GDO fired if(TI_CC_GDO0_PxIFG & TI_CC_GDO0_PIN) { char len=7; if (RFReceivePacket(rxBuffer,&len)) // Fetch packet from CCxxxx { P1OUT ^= 0x01;
rssi = TI_CC_SPIReadStatus(TI_CCxxx0_RSSI);
while(!(IFG2 & UCA0TXIFG));
IFG2 &= ~UCA0TXIFG; UCA0TXBUF = rssi; P1OUT ^= 0x02; } } TI_CC_GDO0_PxIFG &= ~TI_CC_GDO0_PIN; // After pkt RX, this flag is set. }
----------------------------------------------------------
Thanks.
I am also trying to do the same thing. Have you found fixed the problem or find anything good reference? Thanks.