Hello all

I've been trying to acces the values of radio power, but only with
partial success. What I did was create a modified version of the
Oscilloscope application that uses SerialAM components for
comunication, and uses the radio for listening only. I use some
another mote to send random messages.

I've tried to do two things:

1 - packet Rssi

When I receive a message I call CC2420Packet.getRssi and use that
value as if it were a sensor reading. This works, but I don't what is
the meaning of this value. Is it in dB? This value has a very small
variation (comparing to the range of values that an int8_t allows) as
I move the other mote further away from the base mote


2 - ADC sampling
In this variation, I wrote a component, RadioPowerC, to use as the Sensor.
According to the manual, the ADC's channel 0 is the one for sampling
the radio signal, so I wrote the components below to be wired to an
AdcReadClientC's Atm128config interface, but it doesn't work. What
happens is that when I increase the sampling frequency in the java GUI
the value I get also increases. I'm thinking (as I changed the channel
value just for testing and the same happened) that I have to turn
something on before reading, but I don't what it could be.


thanks in advance
Hugo Sousa


/************************ RadioPowerC ******************************/
generic configuration RadioPowerC() {

provides interface Read<uint16_t>;

}

implementation {
        components      RadioPowerDeviceP,
                                new AdcReadClientC() as Adc;

        Read = Adc.Read;
        Adc.Atm128AdcConfig -> RadioPowerDeviceP.Atm128AdcConfig;
}


/************************ RadioPowerDeviceP ******************************/

module RadioPowerDeviceP {
        provides interface Atm128AdcConfig;
}

implementation {

        async command uint8_t Atm128AdcConfig.getChannel() {
            return 0;  // radio sginal adc channel
      }

        async command uint8_t Atm128AdcConfig.getRefVoltage() { return
ATM128_ADC_VREF_OFF;    }

        async command uint8_t Atm128AdcConfig.getPrescaler() {  return
ATM128_ADC_PRESCALE; }

}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to