Re: [Tinyos-help] RSSI with tinyos-1.x and mica2

2012-03-06 Thread Michael Schippling
Here's the battery section right out of the MPR/MIB User’s Manual:

--
6.4  MICA2 Battery Voltage Monitor

The MICA2 units have an accurate voltage reference that can be used to
measure battery voltage (Vbatt). Since the eight-channel, ATMega128L
ADC uses the battery voltage as a full scale reference, the ADC full
scale voltage value changes as the battery voltage changes. In order
to calibrate the battery voltage a precision external voltage
reference is required. The MICA2 uses an LM4041 (Mfg: National
Semiconductor) 1.223 V reference (Vref) attached to ADC channel 7.

NOTE:  ADC channel 7 is also used for JTAG debugging on the Atmega128
processor. MICA2s and MICA2DOTs ship with the JTAG fuse enabled. When
this fuse is enabled the input impedance of channel 7 is lowered which
affects the voltage reference measurement. The fuse must be disabled
if ADC channel 7 is used. See below for information on setting
ATMega128L fuses.

To compute the battery voltage:

1.  Set the BAT_MON processor pin (PA5/AD5) to HI.
2.  Program the application code to measure ADC Channel 7.
3.  Compute battery voltage, Vbatt, from Channel 7’s data by:

  Vbatt = Vref × ADC_ FS ADC_Count

where:
   Vbatt = Battery voltage
   ADC_FS = 1024
   Vref = External voltage reference = 1.223 V
   ADC_Count = Data from the ADC measurement of Channel 7
--

So it looks like you have it mostly right. And, yes, the final
result is the power at the receiver.

Make sure you notice that the Battery Voltage calculation is
inverted from what you'd expect: Full-Scale/Count because what
you are measuring is a fixed voltage using the battery as the
ADC reference...It does actually work once you puzzle it out...
I think you can probably ignore the NOTE about Jtag and maybe
just add a fudge factor to the battery calculation. Or even
just ignore the whole battery thing and use 3.0...

Also, if you are just measuring the RSSI of received messages,
a measurement is appended to each message in TOS_Msg.strength.
However I forget if this is the raw count from ADC-0 or if it
has been massaged into Vrssi or even RSSI. Searching the radio
code for "strength" should elucidate this.

Note that floating point calculations are rather costly as they
are done in software so you might want to use some other
methodology, or just the raw Vrssi...

MS

giacomo_gioacch...@libero.it wrote:
> Hi,
> 
> I am using the mica2 motes with tinyos-1.x. I want measure the RSSI 
> value at the receiver. My motes emit at 433MHz. From the datasheets I 
> have been reading I think that everytime a packet is received the 
> following should be done:
> 
> -read the ADC_Count value from chan[7] of the ADC and use it to obtain 
> Vbatt in: Vbatt= Vref x ADC_FS / ADC_Count
> 
> -read the ADC_Count value from chan[0] of the ADC and use it to obtain 
> Vrssi in: Vrssi= Vbatt x ADC_Count / ADC_FS
> 
> -in the end obtain the RSSI value in dBm in this way: RSSI (dBm)=-51.3 x 
> Vrssi - 49.2
> 
> Is this process correct? If so, is there a way to make the calculation 
> of the RSSI (dBm) on the mote? And last can I assume the RSSI value 
> computed to be the received power at the receiver or there is a 
> conversion I need to do?
> 
> Thanks in advance,
> 
> Giacomo
> 
>  
> 
> 
> 
> 
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] RSSI with tinyos-1.x and mica2

2012-03-06 Thread giacomo_gioacch...@libero.it
Hi,I am using the mica2 motes with tinyos-1.x. I want measure the RSSI value at 
the receiver. My motes emit at 433MHz. From the datasheets I have been reading 
I think that everytime a packet is received the following should be done:-read 
the ADC_Count value from chan[7] of the ADC and use it to obtain Vbatt in: 
Vbatt= Vref x ADC_FS / ADC_Count-read the ADC_Count value from chan[0] of the 
ADC and use it to obtain Vrssi in: Vrssi= Vbatt x ADC_Count / ADC_FS-in the end 
obtain the RSSI value in dBm in this way: RSSI (dBm)=-51.3 x Vrssi - 49.2Is 
this process correct? If so, is there a way to make the calculation of the RSSI 
(dBm) on the mote? And last can I assume the RSSI value computed to be the 
received power at the receiver or there is a conversion I need to do?
Thanks in advance,Giacomo
 ___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help